First, you're using scriptlets ;-)

Most Struts applications can be written without the aid of scriplets.
Before resorting to one, it's important to look for what tag properties
you could use instead.

In this case, you can use the paramName and paramPropeties

<html:link page="/archive.do" paramId="action" paramName="action">
           test
     </html:link>

Though, I personally recommend to avoid use of the page property to the
link tag, and to use forward instead. You can then document all the
entry points to your application as global forwards, and keep both the
paths and most of the query strings out of the page. 

In this case, you would define a global forward like 

     <forward name="archive" path="/archive.do"/>

and then cast the tag as 

<html:link forward="archive" paramId="action" paramName="action">
           test
</html:link>

You can also code partial querty strings into forwards, like 

  <forward name="archiveSearch" path="archiveSearch.do?column=name"/>
  <forward name="archiveSearchDate"
path="archiveSearch.do?column=date"/>

Struts will then intelligently append any other parameters you add with
a link tag.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


chiji nwankwo wrote:
> 
> Hi,
> 
> Thanks to Ted for assisting me earlier on with the iterate tag
> problem, it works fine now.
> 
> Could anyone please tell me what I am doing wrong with the following
> declaration:
> 
> <% String action = "Reset"; %>
> 
>     <html:link page="/archive.do?action=<%=action%>">
>           test
>     </html:link>
> 
> it throws the following exception when I click on the link:
> 
> java.lang.IllegalArgumentException: Decode error
> 
> It works fine when I replace the expression with the string 'Reset'.
> 
> Thanks
> 
> Chiji
> 
> ----------------------------------------------------------------------
> Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to