Plain html not working with struts
I'm trying out two things here: firstly, running a normal jsp with action
as helloWorld.do :
<html:form action="helloWorld.do" method="post">
and the same thing in html too:
<form action="helloWorld.do" method="post">
<input type="text" name="userName"> <!-- userName and password names do
match the variables in form -->
<input type="password" name="password">
<input type="submit" value="Submit">
</form>
When I run the jsp, the action in the jsp maps to the right action and
renders the page correctly but with html it actually calls
http://localhost/StrutsExample/helloworld.do. Here helloWorld.do changed
to helloworld.do. So, it rendered an empty page (this is the page I'm
trying to display the username) So, I tried to add a new action in struts
:
<action path="/helloworld"
type="com.org.common.action.HWdAction"
name="hWForm">
<forward name="success" path="/HW.jsp"/>
</action>
It still does not work. The form does not populate itself with the name
entered in html.
No comments:
Post a Comment