This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes jsp sqk question ? urgent 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 "jsp sqk question ? urgent" Watch "jsp sqk question ? urgent" New topic
Author

jsp sqk question ? urgent

majid nakit
Ranch Hand

Joined: Jun 26, 2001
Posts: 161
I have a drop down list , so I can select each user or
select ALL to get all users like this :
FORM NAME="productGoto">
<FONT FACE="Arial,Helvetica" SIZE="-2">
Select By User:
<SELECT NAME="productList" onChange="gotoFunction()" onBlur="return
options[0].selected = true">
<OPTION VALUE=" "> Categories </OPTION>
<OPTION VALUE="All">All </OPTION>
<OPTION VALUE="Earl Peterson">Earl Peterson</OPTION>
<OPTION VALUE="WDS Domino Backup ">WDS Domino Backup</OPTION>
<OPTION VALUE="Mike Tripp">Mike Tripp</OPTION>
<OPTION VALUE="Heather Lowe">Heather Lowe</OPTION>
<OPTION VALUE="Maureen O'Gorman">Maureen O'Gorman</OPTION>
<OPTION VALUE="Addelmajid Lotfi">Addelmajid Lotfi</OPTION>
<OPTION VALUE="WDS Server ">WDS Server</OPTION>
<OPTION VALUE="<open> ">open</OPTION>
<OPTION VALUE="Carolynn Huntington ">Carolynn Huntington</OPTION>
<OPTION VALUE="Joe Richard ">Joe Richard</OPTION>
<OPTION VALUE="WDS - Video Station ">WDS - Video Station</OPTION>
<OPTION VALUE="Liza Nanni">Liza Nanni</OPTION>
<OPTION VALUE="Ursula Bethoney ">Ursula Bethoney</OPTION>
</SELECT>
</FORM>
When I select just one user it works, but when I select "ALL" it does not
here is the code :
<%
if ((category !=null) && !(category.equals("ALL")) )
{
category = (String)request.getParameter("category"); %>
<sql:query>
select * from pcinfo
where User = '<sql:escapeSql><%=category%></sql:escapeSql>'
</sql:query>
<%
} else if ((category ==null) | | (category.equals("ALL")) ){ %>
<sql:query>
select * from pcinfo order by User
</sql:query>
<%}
%>
thanks

Manjunath Reddy
Ranch Hand

Joined: Jul 26, 2001
Posts: 60
Isnt "ALL" different from "All".
It might be the comparison problem..while ur html posts "All"..u r looking for "ALL"
cheers,
mpr
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp sqk question ? urgent
 
Similar Threads
Drop Down box for Jstl Select query results
Populating one drop down based on the other
JDBCAppender Log4j Help!
Dynamic Drop Down
Using JSTL Data Displayed In Browser Is Getting Fixed To 24576 Bytes(24 KB)