Results 1 to 3 of 3
  1. #1
    Sujatha.G is offline Member
    Join Date
    Dec 2009
    Rep Power

    Default 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 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() %>/" method ="post">
    EmployeeName<input type="text" name="username" value=""></input><br></br>
    <input type="submit" name="submit" value="Submit"></input>

  2. #2
    FON is offline Senior Member
    Join Date
    Dec 2009
    Belgrade, Serbia
    Rep Power


    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 ;)

  3. #3
    Sujatha.G is offline Member
    Join Date
    Dec 2009
    Rep Power

Similar Threads

  1. How to JSP content from a Struts action class
    By DonStruts in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-10-2009, 07:39 AM
  2. action class
    By jayagowri in forum Web Frameworks
    Replies: 1
    Last Post: 05-07-2008, 03:23 PM
  3. Action class in Struts
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-27-2007, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts