struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shuk <>
Subject Problem with Ajax and <s:text> (i18n)
Date Thu, 06 Nov 2008 15:37:25 GMT


I'm trying to add some Ajax functionality to my Struts2 project but
unfortunately encountered a quite annoying problem with the &lt;s:text&gt;
tag. For better understanding, here is the relevant code I'm using:

Ajax div on main page:

    &lt;s:div id="userInfo" theme="ajax" href="/Refresh.action"
         errorText="Unable to load data"&gt;
         placeholder text

Refresh action in struts.xml that simply returns SUCCESS and dispatches to

    &lt;action name="Refresh" class="rpc.RefreshUserInfo"
         &lt;result name="success">/includes/UserInfo.jsp&lt;/result&gt;

UserInfo.jsp which is returned as action result and displayed in the Ajax
div on the main page:

    &lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;
    &lt;!-- The following tags are parsed and displayed correctly. --&gt;
    &lt;s:property value="#session.userInfo.userName" /&gt;, &lt;s:property
value="#session.userInfo.authLevelName" /&gt;

    &lt;!-- The following tag is NOT parsed correctly. Displayed is
"" instead of the value set in the file
    &lt;s:text name=""&gt;
       &lt;s:param value="#session.userInfo.userName" /&gt;
       &lt;s:param value="#session.userInfo.authLevelName" /&gt;

Now, the ajax div loads fine and displays the content of UserInfo.jsp.
However, for some reason it fails to parse the &lt;s:text&gt; tag correctly.
Instead of reading and printing the value associated with
in the file it simply prints "". If I put
the &lt;s:text&gt; tag directly in my jsp file it works perfectly fine
though. I use it at many other places and there is no problem at all. Only
when loading the UserInfo.jsp using Ajax it just does not work. Other
Struts2 tags like the property tag reading a session variable works fine

I really don't know what the problem is and how to fix this. I googled for
hours but unfortunately didn't find anything helpful. Therefore, I would
appreciate any help you guys can provide! Please let me know if you need any
further information or if anything is not clear to you.

Thank you!

View this message in context:
Sent from the Struts - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message