Often I want to perform an action on a page through a hyperlink but this
won't let me use request attributes right?

Imagine I have a series of line items on a page and I wish to delete one
by selecting the hyperlink "Delete" in the table.

When I do this I'm forced to either put stuff in the session or carry
though enough information in the URL itself so I can find the
"objects" again right?

How can I do request dispatcher when I cannot get anything in the request
attributes for the next page?

Is this clear?

Often I have a controller page that fetches the data itself and then put
that into a request attribute and then use "include" to present the result
on a page that doesn't have any business logic at all. The problem comes
when you want to perform some action and then redisplay that page. The
problem is that when your action depends on "objects" and not just strings
you need to carry these over to the controller that handles your action
but you cannot when you perform an action directly through a hyperlink
except with information encoded in the URL. or hidden fields in a
form. Often I want my objects to live past the next request but I don't
want to put them in the session as it's wrong to do that. I mean it's not
wrong but I want some way of doing it by addressing the next page not
explicitly putting something in the session. The problem ultimately is
that JSP doesn't create an object for the page until the response is
requested and so you cannot set any state on any page instance.

---

In a framework like WebObjects Framework from Apple I have a lot more
flexibily because it caches the instances of the Pages themselves. Which
allows me to do this. For any "Action" ie. submit or hyperlink I can
define a method that does

- some action
{

page = getNextPage("some page");
page.setAttribute(some object)
return page (this generates the response and sends it to the browser.)

}

when "some page" generates the response it automatically has the
"attribute" in scope as an object.

How can you do this in JSP? You're literally forced into making up some
key and putting the object in the users session right? That's the only way
to ship objects about in JSP right?

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to