Hi Dave,

Thanks for your reply, you actually helped me to solve the problem! I feel
like an idiot though...

The problem was not the code itself but the fact that my action class was in
a different package as my package.properties file. As a result, the latter
could not be read by my action class nor its dispatcher instance. So it was
simply a problem of the project's package and file structure.

I can't believe that I spent so much time trying to fix the code and that it
never occurred to me that the problem could be elsewhere. Oh well, lesson
learned I guess :)

Sorry for bothering you guys and thanks again, Dave!

Shuk



newton.dave wrote:
> 
> What happens if you call the action directly? Does the action in question
> extend ActionSupport at some point?
> 
> Dave
> 
> --- On Thu, 11/6/08, Shuk wrote:
>> I'm trying to add some Ajax functionality to my Struts2
>> project but
>> unfortunately encountered a quite annoying problem with the
>> <s:text>
>> tag. For better understanding, here is the relevant code
>> I'm using:
>> 
>> 
>> Ajax div on main page:
>> 
>>     <s:div id="userInfo"
>> theme="ajax" href="/Refresh.action"
>>          loadingText="Loading..."
>>          errorText="Unable to load data">
>>          placeholder text
>>     </s:div>
>> 
>> 
>> 
>> Refresh action in struts.xml that simply returns SUCCESS
>> and dispatches to
>> UserInfo.jsp:
>> 
>>     <action name="Refresh"
>> class="rpc.RefreshUserInfo"
>> method="execute">
>>          <result
>> name="success">/includes/UserInfo.jsp</result>
>>     </action>
>> 
>> 
>> 
>> UserInfo.jsp which is returned as action result and
>> displayed in the Ajax
>> div on the main page:
>> 
>>     <%@ taglib prefix="s"
>> uri="/struts-tags" %>
>>     <!-- The following tags are parsed and displayed
>> correctly. -->
>>     <s:property
>> value="#session.userInfo.userName" />,
>> <s:property
>> value="#session.userInfo.authLevelName" />
>> 
>>     <!-- The following tag is NOT parsed correctly.
>> Displayed is
>> "lbl.logged.in.as" instead of the value set in
>> the package.properties file
>> -->
>>     <s:text
>> name="lbl.logged.in.as">
>>        <s:param
>> value="#session.userInfo.userName" />
>>        <s:param
>> value="#session.userInfo.authLevelName" />
>>     </s:text>
>> 
>> 
>> 
>> Now, the ajax div loads fine and displays the content of
>> UserInfo.jsp.
>> However, for some reason it fails to parse the
>> <s:text> tag correctly.
>> Instead of reading and printing the value associated with
>> lbl.logged.in.as
>> in the package.property file it simply prints
>> "lbl.logged.in.as". If I put
>> the <s:text> 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
>> however.
>> 
>> 
>> 
>> 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!
>> 
>> Shuk
>> -- 
>> View this message in context:
>> http://www.nabble.com/Problem-with-Ajax-and-%3Cs%3Atext%3E-%28i18n%29-tp20363416p20363416.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-Ajax-and-%3Cs%3Atext%3E-%28i18n%29-tp20363416p20366151.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to