File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes is it good practice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "is it good practice?" Watch "is it good practice?" New topic
Author

is it good practice?

Madhu Sudhana
Ranch Hand

Joined: Apr 16, 2006
Posts: 127
Hi Ranchers

Is it a good practice to make use of the following code in action clsses

reuest.getParameter("abcd");
request.setAttribute("abcd");

session.setAttribute("abcd");
session.getAttribute("abcd");

if not how can we do it???

I need a reply soooon

thank you


"And the trouble is, if you don't risk anything, you risk even more." -- Erica Jong.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Sudhana,
Two things in this:
1) It is prefered to use form.getXXX() rather than request.getParameter()
2) You usually don't want to put the same attribute in both the request and session. I'm not sure if you are actually doing this or just used "abcd" to represent any name.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is it good practice?
 
Similar Threads
How to display Hibernate Set to JSF Datatable
Assertions
sds
Learning Guitar
Correct implementation of hashcode()