• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

getting error

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
machines help you to do more, but experience less. Experience this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic