error with implementing a basic struts example
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I am trying to implement a simple struts example but am getting a few errors when trying to call the action servlet .
My input html page has the following
The form bean for this html is
while my action object class is as follows
The web.xml file has the following mapping
and the struts-config.xml file has the following
display.jsp is just a jsp page which calls the attributes i saved in the action object and displays them
I am able to launch tomcat but when i click the submit button of the html page i.e request the action servlet i get the following exception
can anyone help me figure out what i am doing wrong
My input html page has the following
The form bean for this html is
while my action object class is as follows
The web.xml file has the following mapping
and the struts-config.xml file has the following
display.jsp is just a jsp page which calls the attributes i saved in the action object and displays them
I am able to launch tomcat but when i click the submit button of the html page i.e request the action servlet i get the following exception
can anyone help me figure out what i am doing wrong
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Are you deploying to the root context? Can you access the action directly? (Calling an action "controllerServlet" is *really* misleading, since it's neither the controller, nor a servlet, btw.)
Also, there's no reason to validate against the request parameter directly in validate(); that somewhat defeats the purpose of having the ActionForm. I'd also recommend using the Struts HTML tags to implement the form, but that's a separate issue.
Also, there's no reason to validate against the request parameter directly in validate(); that somewhat defeats the purpose of having the ActionForm. I'd also recommend using the Struts HTML tags to implement the form, but that's a separate issue.
sandeep raj
Greenhorn
Posts: 10
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
thanks david.. this was actually my first trial of implementing a struts example so i was more focused on getting it to work .. thanks for the input though.. i figured out the mistake btw .. i made the blunder of spelling the controller servlet action in the action mapping of struts-config.xml with a capital 'C'
| Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads. Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |










