Solved

Multiple params with html:link tag

Posted on 2006-10-22
4
195 Views
Last Modified: 2010-04-01
Hi,
In struts , how to pass a argument dynamically using the html:link and how to get that variable in the action class?

Regards
HK
0
Comment
Question by:harishkg
  • 2
  • 2
4 Comments
 

Author Comment

by:harishkg
ID: 17786774
<html:form action="/editClient">
<%
      ArrayList<Client> clientList = null;
      Object obj = request.getSession().getAttribute(LabelResources.CLIENTS.getMessage());
      if(obj instanceof ArrayList){
            clientList = (ArrayList<Client>)obj;
      }
      Iterator<Client> iter = clientList.iterator();
%>
                                                
<%
      long x;
      while(iter.hasNext()){
            Client client = iter.next();
            x=client.getId();
      %>
<TR>
<TD>
<!-- < html : option value="< % =client.getName()% > "> -->
<%=client.getName()%>
<!--  < / html : option> -->
</TD>
<TD>
<html:link action="/editClient?methodName=edit">edit</html:link>
</TD>

Like, how should I pass the clientID to the action in the above <html:link ??
0
 
LVL 4

Expert Comment

by:Tol_cv
ID: 17786811
in jsp:

<html:link action="/editClient?methodName=edit"  paramId="clientlId" paramName="client" paramProperty="id">

in your action:
<yourformbean>.getClientId();

 of course that means that your form has a property  clientId in it
0
 

Author Comment

by:harishkg
ID: 17786848
I used this
<html:link action="/editClient?methodName=edit"  paramId="clientId" paramName="client" paramProperty="id">edit</html:link>

org.apache.jasper.JasperException: Exception in JSP: /admin/icf/icf_list_client.jsp:50
this is the exception I got:

47:                                                       </TD>
48:                                                       <TD>
49:
50:                                                                    <html:link action="/editClient?methodName=edit"  paramId="clientId" paramName="client" paramProperty="id">edit</html:link>
51:                                                       </TD>
52:                                                 </TR>
53:                                           <%

root cause:
 javax.servlet.ServletException: Cannot find bean: "client" in any scope

0
 
LVL 4

Accepted Solution

by:
Tol_cv earned 50 total points
ID: 17788205
sorry i assumed you have a client bean in your jsp

<html:link page='"/editClient?methodName=edit&clientlId="+<%=client.getId()%>' />
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: This is the third blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   We’ve been talki…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now