Jsp to Action class
Am new to jsp and action. i have written 2 jsp's named Registration.jsp and secon one is next.jsp . I want to capture the data which is present in Registration.jsp in struts action class naeme RegisterAction class.how can i do that .CAn anyone reply for this .
my code is like this :
<form action=Next.jsp method="post">
Name : <input type="text" name="Ename" value=""></input><br></br>
Address: <input type="text" name="Eaddress" value=""></input><br></br>
<input type="submit" name="submit" value ="Next"></input>
<form name="suji" action="<%=request.getContextPath() %>/RegAction.do" method ="post">
EmployeeName<input type="text" name="username" value=""></input><br></br>
<input type="submit" name="submit" value="Submit"></input>
If you are new to this take your time.
Take care about responsibilities in you app:
who and how creates request (jsp), who and how does something
with that request(servlet) and how is result displayed to end user(jsp)
First you have to understand what basic servlet is.
Second, create a simple form in JSP, let's say Registration.jsp,
and put action attribute of form
to point at servlet you created.
When servlet is done with reading params from Registration.jsp
create some king of response for end user
and use servlet to bring it to some Result.jsp and display a result on it.
Only if you have full understanding of how and why this process
described above is done in that way,
and not just sending requests from one jsp page to another,
do move on to struts.
On very beginning of your learning of struts,
be sure to memorize picture of full life-cycle of each request
and responsibilities of each module
(find "struts-architecture.gif" on google)
Then move on, using some tutorial.
You need to be real patient if you planned
to eat all this in one time ;)
Thank you so much .I wil do that