how to use a href in struts JSP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ong_CY
Posted On:   Monday, October 22, 2001 02:42 AM

hi all,

i try to pass dynamic data using a href but it seems fail to work in struts.



original JSP:


<%=bean.getFILENAME()%>">



Struts JSP:


<%=bean.getFILENAME()%> ;



i can't get the <%=bean.getFILENAME()%> value when using struts.can anyone help?



regards,
CY

Re: how to use a href in struts JSP?

Posted By:   Ted_Husted  
Posted On:   Monday, October 22, 2001 10:54 AM

The html:link tag is designed so that you can do that
without resorting to scriptlets. Try:

paramProperty="FILENAME" paramId="filename"/>


(Though, you may have problems unless the accessor is
named getFilename, per the conventions.)


{soapbox}


Personally, I discourage use of the page form of html:link,
and always use global forwards instead. This way all the
entry points to your application are documented, and
you don't have to expose API features like "action=w"
in the JSP. You can give the action=w forward a logical name,
and use that instead.



In struts-config:



In your JSP:

paramId="filename"/>


In my own applications, the only place I expose the name of
another Action is in the html:form tags (and I'm working
on that;-)


{/soapbox}


HTH - Ted

About | Sitemap | Contact