If the sole purpose of your link is to call the client side javascript
function submit() do you really need to use <html:link> ? It ads no
functionality for you and just wastes server side processing time
converting the <html:link> tag to the final output <a href="">.

<html:link/> is hugely useful to automagically manage non-cookie
sessions by adding session ids to your URLs but in this case you're not
using that ability as you are just calling some javascript.

I'd just use <a href="#" onclick="submit()"> 

If anyone has a reason why this would be bad, please let me know....


-----Original Message-----
From: Jaakko Rytinki [mailto:[EMAIL PROTECTED] 
Sent: 16 March 2004 15:31
To: Struts Users Mailing List
Subject: Tiles and html:link onclick=submit()

I've noticed an annoying feature using <html:link page="#"
onclick="submit();"> someText </html:link>. It does one of the
following: a) It tries to search the page /somePage.jsp# or b) submits
the form and continues to the right page, where my action forward
points.

Because the only JSP-pages I have is just index.jsp, which just checks
the users role and redirects to right XYZlayout.jsp. XYZlayout.jsp is
also a complete JSP-page, but if the user is not in the right role,
container based authentication prevents the page from being retrieved.
Also in the most cases the XYZlayout.jsp requires some parameters, so a
forward action must be called before continuing to that page. 

I've solved this problem, by replacing the actual links by <td
onclick="submit();"> someText </td> And using some style definition the
look and feel are almost exactly the same as when using html:link.
Anyway I was just wondering if someone else has encountered the same
kind of problem and are there any work-arounds for this issue? The same
problem occurs with both IE and Opera.

--

One more question:
Is it possible to use

<form-property name="strings" type="java.lang.String[]" />

for set of html:text areas? For example if I iterate through
a collection of strings, 

<logic:iterate id="aString" property="stringArray">
<html:text property="strings" indexed="true" value="${aString}" />
</logic:iterate>

can I retrieve them by using

DynaActionForm dynaForm = (DynaActionForm) form;
String[] strings = dynaForm.get("strings");


--
Jaakko Rytinki



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to