• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

getting error

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
I am learing struts1.1 now I added an entry to <action> as follows
<action
path="/userRegistration"
type="strutsTutorial.UserRegistrationAction">
<forward name="success" path="/regSuccess.jsp"/>
</action>
so whenever request with userRegistration.do came it will forward that to userRegistrationAction.java in strutsTutorial package.I build this using Ant utility it's saying build successful but in between it displaying import javax.servlet is not found.
my userRegistration.java is as follows
package strutsTutorial;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class UserRegistrationAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return mapping.findForward("success");
}
}
When I deployed the strutsTutorial.war to tomcat4.1(by placing it in tomcat-home/webapps directory)it displaying the following message


HTTP Status 400 - Invalid path /userRegistration was requested

--------------------------------------------------------------------------------

type Status report

message Invalid path /userRegistration was requested

description The request sent by the client was syntactically incorrect (Invalid path /userRegistration was requested).


--------------------------------------------------------------------------------

Apache Tomcat/4.1.31

I don't know how to recover from this error.
Please help me.
Thanks alot
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by anupa oru:
I build this using Ant utility it's saying build successful but in between it displaying import javax.servlet is not found.


If the build script is not compiling something, that's probably the problem. Try adding servlet.jar (e.g. from your Tomcat installation) into the classpath and compile again.
 
He baked a muffin that stole my car! And this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!