File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Determing which enum from request.getParameter( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Determing which enum from request.getParameter("sortBy");" Watch "Determing which enum from request.getParameter("sortBy");" New topic

Determing which enum from request.getParameter("sortBy");

Tariq Jamal

Joined: Jun 09, 2009
Posts: 2
Please bear with me as I am brand new to Java.

I have an enum in my model. This enum has several sort by types, Name, Status, Default. Each of these enum's have two properties, their column name (used by a DAO implementation) and a description (used by the JSP page to provide a drop down menu)

Now there are 2 things I need to know.

1) How do I dislpay these to the page. My guess is the following.

/* this goes into my page action */

/* this goes no the jsp page */

2) How do I get the request back from the page?
I don't have a clue on how to do this, other than a case statement, because the request.getParameter("productSortBy") is a String.
Is there a simpler way to do this?

I agree. Here's the link:
subject: Determing which enum from request.getParameter("sortBy");
Similar Threads
Display information related to that link
Toughest Questions for Oracle JSP Servlet (SCWCD 5.0) Doubts
Problem with datetime fields
How to loop through data on a jsp form?
How to use Break / exist statement here in foreach (JSTL)