File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts" Watch "Struts" New topic


jahurul Islam

Joined: Aug 18, 2011
Posts: 4

in my struts2+hibernate project i execute this

tx = session.beginTransaction();

String sqlQuery = "select distinct(n.diagonasis_desc) from com.csms.model.DiagonasisInfo as n where n.diagonasisId="+id;
Query query = session.createQuery(sqlQuery);

catch (RuntimeException e)
if(tx != null) tx.rollback();
}catch(Exception e){

return baseInfoList;

all execution completely ck but it do not show any value in jsp
<s:iterator value="baseInfoList" status="status">
<option value="<s:property value=""/>"><s:property value="diagonasis_desc"/></option>
please help me . N.B it my first post.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

you can pass the list to select tag directly refer the link

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
jahurul Islam

Joined: Aug 18, 2011
Posts: 4
Mohana Rao wrote:you can pass the list to select tag directly refer the link

Thanks guy for your response, Actually I solved that problem by using script let like this

<select name="resTypeId" id="resTypeId" style="width:160px; height: 20px; float: left;" onchange="change_Category(this, 'resCatId')">
<option value="select" selected="selected">Select</option>
for(int i=0; i<resType.size(); i+=2){
<option value="<%out.print(resType.get(i)); %>"><%out.print(resType.get(i+1)); %></option>
<%} %>

But I want to know is it not possible to print distinct query value by using <s:property value="diagonasis_desc"/>, please conceptually help me. by showing s:property architecture.
jahurul Islam

Joined: Aug 18, 2011
Posts: 4
Bear Bibeault wrote:Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.

Also, plea try to use better subjects than just "Struts".

Thanks boss , From next time I try to use better subject .
I agree. Here's the link:
subject: Struts
It's not a secret anymore!