-
Aug 22nd, 2007, 12:22 AM
#1
Spring managed Struts (1.3) actions run multiple times...?
I'm using Spring 2 and Struts 1.
My JSP is a bit unorthodox as I am not submitting forms, but using a form to pass data into the JSP from which I can build URLs for links within the resultant page. Browser users click the links, not submit buttons. The URLs are built with form properties tacked on as parameters.
So I have a Struts <action path="/dosomething" name="someform" ....>...</action> and a corresponding bean in my Spring config. The JSP declares a <html:form name="/dosomething></html:form> and within the html:form takes, I create links like:
<c: url var="somethingUrl" value="/dosomething.html">
<c: param name="someProp" value="${someform.someValue}"/> /c: url>
<a href="<c: out value="${somethingUrl}" escapeXml="false"/>">[click me]</a>
What seems to be happening is that the after the first running of the action, the browser will display, and then the action does its subsequent runs. But my logs will show debug output of multiple runs. Running via the debugger in my IDE verifies this. Only after I refresh the data coming to the browser (using an innocuous action) can I see the effects of the subsequent runs. There's nothing I can see within my JSPs (like a refresh or someting) that would cause this.
I know this might seem like a Struts issue, but I do not think it is. I've written things using this building concept before, without Spring, and it has been just fine.
And ideas?
-
Aug 23rd, 2007, 11:46 PM
#2
I've been trying to get my appCtx.xml and struts-config.xml to be as simple as possible. No change. Any suggestions would be appreciated. Here's some links for fodder:
appCtx.xml: http://freshet.svn.sourceforge.net/v...ml?view=markup
struts-config.xml: http://freshet.svn.sourceforge.net/v...ml?view=markup
thanks,
Jason
-
Aug 25th, 2007, 03:31 AM
#3
I figured it out. This is ridiculous.
I began searching within Google on the problem without including Spring in my search terms and stumbled upon a fellow how had Struts actions running twice. It seems in his JSP he had <img> tags with empty src attributes, <img src=""/>. I had done this in anticipation of supplying images later, so that my 'alt' attribute text would come up for the time being. It turns out that, for some reason I do not know, this causes multiple location changes/submits/etc... I put some garbage into the src attribute and the problem disappeared.
Guess this isn't a Spring (or Struts) issue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules