jsp:forward equivalent in servlets?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DiggidyMack69

    jsp:forward equivalent in servlets?

    Hello all,
    I use <jsp:forward page="" /> tag in a couple JSP's I've written and
    was wondering if there is an equivalent when writting Java servets?

    thanks,
    DM
  • Chris Harbert

    #2
    Re: jsp:forward equivalent in servlets?

    Check out the sendRedirect() method of the response object passed in
    the doGet and doPost methods.

    At some point you may also want to check out the RequestDispatch
    class. It lets you directly transfer control of a request to another
    servlet.

    DiggidyMack69@h otmail.com (DiggidyMack69) wrote in message news:<c86ce4f.0 308060652.54abf [email protected] gle.com>...[color=blue]
    > Hello all,
    > I use <jsp:forward page="" /> tag in a couple JSP's I've written and
    > was wondering if there is an equivalent when writting Java servets?
    >
    > thanks,
    > DM[/color]

    Comment

    • John

      #3
      Re: jsp:forward equivalent in servlets?


      Example working code :


      (See the forward and redirect methods towards the bottom of the Controller)

      DiggidyMack69 wrote:
      [color=blue]
      >Hello all,
      >I use <jsp:forward page="" /> tag in a couple JSP's I've written and
      >was wondering if there is an equivalent when writting Java servets?
      >
      >thanks,
      >DM
      >
      >[/color]

      Comment

      Working...