Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

<html:link is not working with dynamic value

<html:link is not working with dynamic value

 
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Sat Nov 15, 2008 8:05 am    Post subject: <html:link is not working with dynamic value Reply with quote

Hello friends
I am using <html:link tag in my struts application. When i use simple <html:link option, it is working fine. When i use request.getParameter with <html:link tag it stops working and throws error.

Quote:
<html:link page="/Univ.do?id=<%=request.getParameter("ID")%>">Link forword</html:link>


This line stops working with any variable added to page attribute.

How to use variable or dynamic value send with this link of struts.
Back to top
View user's profile Send private message
javatech



Joined: 19 Jan 2007
Posts: 39

PostPosted: Tue Nov 18, 2008 4:12 pm    Post subject: Reply with quote

struts <html:link> tag can not directly take jsp tag inside of struts tag. We have to define in bean tag of html struts and then we can use this property in link tag of struts.

<bean:define> where we have to define our property and use

suppose if you want to use

Code:
href="page.jsp?id=<%=request.getParameter("ID")%>"


you can

Code:
<bean:define id="ID" type="java.lang.String">
   <%=request.getParameter("ID")%>
</bean:define>
<html:link page="page.jsp?id=${ID}" >Link to follow</html:link>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack