top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Struts:: s:action tag showing result

0 votes
617 views

I have been using struts quite a long time, but in the last days I have faced a strange behaviour of s:action tag.

In my JSP I am using the tag action to load list to be used to mount my s:select. But in the redered HTML, the result of the action is showing, even when the executeResult is false.

There is something I missing?

JSP code:

struts.xml:

 ^estados[d+].idEstado,
 ^estados[d+].nmEstado

As you can see, in the struts.xml, I have only json result, and I only need as json, but when I use the action tag, I just only need the populated list to be used in the select tag. It is working very well, but the problem is that the json result is showing in the HTML. And it is showing in the top, not in the action tag position, what is strange.

Also, I try to change the struts.devMode to false, but nothing changes.

The project is using struts 2.3.14.3 with rest-plugin. But for this kind ok action, I avoid rest and use just json-plugin.

posted Jun 20, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Have you tried to use the previous versions?

1 Answer

0 votes

I'm facing not the same, but a strange behavior too with "s:action tag" since Struts version 2.3.12.

I'm using them in similar way than Felipe, so it load some Lists to be used later for Select Fields filling. It worked well until change struts version form 2.3.8 to 2.3.12 and later.

Now, it works well when I start up the server for the first app that get called, but not for the other apps that may use the same technique but get called later. If I redeploy the app that was working (without restarting the whole Tomcat server), it doesn't work any more.

I'm facing "random" results too with s:form field tags (such s:input and so on), in which they some times use the default "theme" to create the html code and other times use the "simple" theme (which is the one I've set in strus.xml). It happen randomly, any time the page its reloaded in the browser it may change the result.

answer Jun 21, 2013 by anonymous
I try struts v. 2.3.8, and everything works fine. But, the first version I've notice this strange behaviour was 2.3.12.

I try to find the ftl file for the action tag, but I could no find it. There is a special file? How does it works?
Could you try with the latest (almost released) version 2.3.15?

I was checking locally with struts2-blank app and everything works, but maybe my setup is a bit different. If so I will need an example app (maven based the best).
Similar Questions
0 votes

In the context of an tag, for instance for a login action, we previously always coded forms as :

 ....

And in the struts.xml we have been using :

content.login
 content.menu
 summary_input
 welcome

This has worked in the past and allowed us to not only use the action="login" to target the execute method of the action, but also to build links to, for instance, login_checkStatus.action to target other, specific methods within the action. I am not sure this Is a common/best practice, I had no prior struts2 experience before joining this company and this is how a lot of the existing functionality is coded. (If this is wrong/there is a better way, please let me know)

Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)

The only workaround we have found so far is to add the '.action' suffix to the
s:form's action attribute. Before it was always added for us by struts.

So now we are having success with

 ...

I can only assume that this has been affected by the changes related to S2-015 and the wildcard action matching.

+1 vote

I am in the process of upgrading my struts2.3.1.2 application to struts2.3.15.1. Everything works fine except the and tags. In struts2.3.1.2, I have the following code in jsp file

  %{stateName}
  Add 

I used to get correct state name when using struts2.3.1.2. However, using struts2.3.15.1, I am getting the following on web-browser page: %{stateName}

0 votes

i need to have multiple on single web page,

(at top panel, our site always provide parts search box/)
(at middle panel, could have other form such as checkout section, login section, etc)

when any single form's validation triggered, then and displayed at all form's textfields place,

how to solve it? or that is struts 2 bug? please help...

+1 vote

We are using struts2 latest distribution, where we are using tokenSession interceptor for duplicate submission. Duplicate request processing is working fine but its not showing result page for duplicate
form submission which we have defined in strust.xml as below.

/error/accessDenied.jsp
/error/invalidRequest.jsp

+1 vote

Will it restrict the information being stored at the browser cache.

...