Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multiple params with html:link tag

Posted on 2006-10-22
4
Medium Priority
?
212 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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

963 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