H
howboutafresca
Hi everyone,
I'm trying to incorporate the MVC into my J2EE 1.4 project for school.
I'm new to this and had a couple of questions?
I understand that a typical way of handiing form posts from a JSP page
is to post to a servlet, which examines a request variable or two,
maybe does a little processing using beans and whatnot, and then
forwards the request to a JSP for display. Sounds good.
However, how can I efficiently handle / code URL links in my JSP pages,
so that the servlet knows what to do? Say for instance I have a JSP
with a few hyperlinks in it. When I click on one of them I'll go to a
servlet, which then forwards me to the proper JSP. But how does the
servlet know where to forward me?
I suppose I could add a URL variable to the hyperlinks, to be used by
the servlet. I'm curious if there's a better way to go about this -
maybe via a few calls to request.setAttribute() in the initial JSP
page? I'm a little leery of appending info to the hyperlinks. Maybe
for no good reason, but I thought I'd ask if there's a better way.
Thanks!
I'm trying to incorporate the MVC into my J2EE 1.4 project for school.
I'm new to this and had a couple of questions?
I understand that a typical way of handiing form posts from a JSP page
is to post to a servlet, which examines a request variable or two,
maybe does a little processing using beans and whatnot, and then
forwards the request to a JSP for display. Sounds good.
However, how can I efficiently handle / code URL links in my JSP pages,
so that the servlet knows what to do? Say for instance I have a JSP
with a few hyperlinks in it. When I click on one of them I'll go to a
servlet, which then forwards me to the proper JSP. But how does the
servlet know where to forward me?
I suppose I could add a URL variable to the hyperlinks, to be used by
the servlet. I'm curious if there's a better way to go about this -
maybe via a few calls to request.setAttribute() in the initial JSP
page? I'm a little leery of appending info to the hyperlinks. Maybe
for no good reason, but I thought I'd ask if there's a better way.
Thanks!