Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 31 Jul 2008 14:43:12 -0000 Issue 8171

user-digest-help

2008-07-31


Author LoginPost Reply

user Digest 31 Jul 2008 14:43:12 -0000 Issue 8171

Topics (messages 189506 through 189533):

Re: Struts 2 And JFreeChart
 189506 by: Randy Burgess
 189510 by: Laurie Harper
 189519 by: Martin
 189530 by: Randy Burgess

Re: struts record output and entry
 189507 by: Givler, Eric

Re: Redirect after stream result
 189508 by: ManiKanta G
 189520 by: Martin
 189521 by: ManiKanta G

Create multiple struts configuration file problem
 189509 by: angelwei
 189524 by: Dave Newton

Regarding Struts 1.3 and Eclipse 3.3
 189511 by: bhba

Re: Strange Behaviour in FireFox3
 189512 by: Markus Stauffer
 189513 by: nauke.

<s:a dojo-anchor, seems like better not to use it and realize it yourself
 189514 by: holod
 189518 by: Dave Newton

Re: Is it a bug in Struts 1.2 that you can't iterate through a java.util.Set?
 189515 by: Ylva Degerfeldt

Re: possibly strange namespace use case
 189516 by: Andy Law
 189522 by: Jeromy Evans
 189528 by: Andy Law

Re: [S2] Testing if session variable is present
 189517 by: Milan Milanovic
 189523 by: Dave Newton
 189531 by: Milan Milanovic
 189532 by: Milan Milanovic

Browser url & parameters
 189525 by: Pascal Lalonde

Re: namespace question
 189526 by: Kibo

Re: Stuts 2 and Custom TextProvider
 189527 by: stanlick

My Action was three times executed
 189529 by: Johannes Geppert

Re: Wierd Validation
 189533 by: Gundersen, Richard

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_189506.ezm (zipped)
Ajax is text only so you can't use it with an image type.

Regards,
Randy Burgess
Sr. Software Architect
D5 Systems, LLC


> From: cree <vint@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Wed, 30 Jul 2008 12:14:02 -0700 (PDT)
> To: <user@(protected)>
> Subject: Struts 2 And JFreeChart
>
>
> Hello Everyone,
>
> Got a quick question regarding the streaming of a JFreeChart (or any image)
> and how to be able to handle it on a jsp. I have create a servlet that will
> stream out an image to the jsp using a syntax similar to (in my struts.xml):
>
> <action name="testChart"
> class="TestBarChart">
> <result name="success" type="chart">
> 350
> 300
> </result>
> </action>
>
> So if I, in my html, created an img tag such that <img
> src="testChart.action"/ , it will correctly create the chart. My problem
> arises when I am using it under a dynamic context. For example, if
> initially I submit a form button (theme="ajax" targets="divTarget") then it
> would render new data and an initial image.
>
> If I submit the form again with different user input the data would change
> but the image is still the same. I assume it is the same buffered image that
> it first loaded, but the action itself will never get reloaded. The action
> would not get executed at all.
>
> My question is whether there is a way I can manually force the img tag to
> invoke the action itself.
>
> Thanks for any input
> --
> View this message in context:
> http://www.nabble.com/Struts-2-And-JFreeChart-tp18740589p18740589.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



Attachment: user_189510.ezm (zipped)
I don't see what Ajax has to do with this... It sounds more like an HTTP
caching issue. Cree, if you do a page refresh, is the image updated
correctly? I haven't used the JFreeChart result, but maybe it's not
setting the right cache control headers.

L.

Randy Burgess wrote:
> Ajax is text only so you can't use it with an image type.
>
> Regards,
> Randy Burgess
> Sr. Software Architect
> D5 Systems, LLC
>
>
>> From: cree <vint@(protected)>
>> Reply-To: Struts Users Mailing List <user@(protected)>
>> Date: Wed, 30 Jul 2008 12:14:02 -0700 (PDT)
>> To: <user@(protected)>
>> Subject: Struts 2 And JFreeChart
>>
>>
>> Hello Everyone,
>>
>> Got a quick question regarding the streaming of a JFreeChart (or any image)
>> and how to be able to handle it on a jsp. I have create a servlet that will
>> stream out an image to the jsp using a syntax similar to (in my struts.xml):
>>
>> <action name="testChart"
>> class="TestBarChart">
>> <result name="success" type="chart">
>> 350
>> 300
>> </result>
>> </action>
>>
>> So if I, in my html, created an img tag such that <img
>> src="testChart.action"/ , it will correctly create the chart. My problem
>> arises when I am using it under a dynamic context. For example, if
>> initially I submit a form button (theme="ajax" targets="divTarget") then it
>> would render new data and an initial image.
>>
>> If I submit the form again with different user input the data would change
>> but the image is still the same. I assume it is the same buffered image that
>> it first loaded, but the action itself will never get reloaded. The action
>> would not get executed at all.
>>
>> My question is whether there is a way I can manually force the img tag to
>> invoke the action itself.
>>
>> Thanks for any input
>> --
>> View this message in context:
>> http://www.nabble.com/Struts-2-And-JFreeChart-tp18740589p18740589.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>


Attachment: user_189519.ezm (zipped)
it does sound like a caching issue.. try this directive before your <html>
<%
  response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
  response.setHeader("Pragma", "no-cache"); //HTTP 1.0
  response.setDateHeader("Expires", 0); //prevents caching at the proxy
server
%>

?
Martin
----- Original Message -----
From: "Laurie Harper" <laurie@(protected)>
To: <user@(protected)>
Sent: Thursday, July 31, 2008 2:28 AM
Subject: Re: Struts 2 And JFreeChart


>I don't see what Ajax has to do with this... It sounds more like an HTTP
>caching issue. Cree, if you do a page refresh, is the image updated
>correctly? I haven't used the JFreeChart result, but maybe it's not setting
>the right cache control headers.
>
> L.
>
> Randy Burgess wrote:
>> Ajax is text only so you can't use it with an image type.
>>
>> Regards,
>> Randy Burgess
>> Sr. Software Architect
>> D5 Systems, LLC
>>
>>
>>> From: cree <vint@(protected)>
>>> Reply-To: Struts Users Mailing List <user@(protected)>
>>> Date: Wed, 30 Jul 2008 12:14:02 -0700 (PDT)
>>> To: <user@(protected)>
>>> Subject: Struts 2 And JFreeChart
>>>
>>>
>>> Hello Everyone,
>>>
>>> Got a quick question regarding the streaming of a JFreeChart (or any
>>> image)
>>> and how to be able to handle it on a jsp. I have create a servlet that
>>> will
>>> stream out an image to the jsp using a syntax similar to (in my
>>> struts.xml):
>>>
>>> <action name="testChart"
>>> class="TestBarChart">
>>> <result name="success" type="chart">
>>> 350
>>> 300
>>> </result>
>>> </action>
>>>
>>> So if I, in my html, created an img tag such that <img
>>> src="testChart.action"/ , it will correctly create the chart. My
>>> problem
>>> arises when I am using it under a dynamic context. For example, if
>>> initially I submit a form button (theme="ajax" targets="divTarget") then
>>> it
>>> would render new data and an initial image.
>>>
>>> If I submit the form again with different user input the data would
>>> change
>>> but the image is still the same. I assume it is the same buffered image
>>> that
>>> it first loaded, but the action itself will never get reloaded. The
>>> action
>>> would not get executed at all.
>>>
>>> My question is whether there is a way I can manually force the img tag
>>> to
>>> invoke the action itself.
>>>
>>> Thanks for any input
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Struts-2-And-JFreeChart-tp18740589p18740589.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_189530.ezm (zipped)
I don't use the Ajax theme or any of the Dojo integration but I assumed that
if theme=ajax on the submit button that it would be using Ajax.

Regards,
Randy Burgess
Sr. Software Architect
D5 Systems, LLC


Regards,
Randy Burgess
Sr. Software Architect
D5 Systems, LLC


> From: Laurie Harper <laurie@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Thu, 31 Jul 2008 02:28:41 -0400
> To: <user@(protected)>
> Subject: Re: Struts 2 And JFreeChart
>
> I don't see what Ajax has to do with this... It sounds more like an HTTP
> caching issue. Cree, if you do a page refresh, is the image updated
> correctly? I haven't used the JFreeChart result, but maybe it's not
> setting the right cache control headers.
>
> L.
>
> Randy Burgess wrote:
>> Ajax is text only so you can't use it with an image type.
>>
>> Regards,
>> Randy Burgess
>> Sr. Software Architect
>> D5 Systems, LLC
>>
>>
>>> From: cree <vint@(protected)>
>>> Reply-To: Struts Users Mailing List <user@(protected)>
>>> Date: Wed, 30 Jul 2008 12:14:02 -0700 (PDT)
>>> To: <user@(protected)>
>>> Subject: Struts 2 And JFreeChart
>>>
>>>
>>> Hello Everyone,
>>>
>>> Got a quick question regarding the streaming of a JFreeChart (or any image)
>>> and how to be able to handle it on a jsp. I have create a servlet that will
>>> stream out an image to the jsp using a syntax similar to (in my struts.xml):
>>>
>>> <action name="testChart"
>>> class="TestBarChart">
>>> <result name="success" type="chart">
>>> 350
>>> 300
>>> </result>
>>> </action>
>>>
>>> So if I, in my html, created an img tag such that <img
>>> src="testChart.action"/ , it will correctly create the chart. My problem
>>> arises when I am using it under a dynamic context. For example, if
>>> initially I submit a form button (theme="ajax" targets="divTarget") then it
>>> would render new data and an initial image.
>>>
>>> If I submit the form again with different user input the data would change
>>> but the image is still the same. I assume it is the same buffered image that
>>> it first loaded, but the action itself will never get reloaded. The action
>>> would not get executed at all.
>>>
>>> My question is whether there is a way I can manually force the img tag to
>>> invoke the action itself.
>>>
>>> Thanks for any input
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Struts-2-And-JFreeChart-tp18740589p18740589.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



Attachment: user_189507.ezm (zipped)
In order to get a grasp of this, it would be helpful if you read the following:

Succeeding With Struts: Dynaforms
By James M. Turner
http://www.developer.com/java/web/article.php/2214681

Succeeding With Struts: Indexed Properties and Beans as Properties
By James M. Turner
http://www.developer.com/java/ejb/article.php/2233591

Succeeding With Struts: Dynamically Sized Forms
By James M. Turner
http://www.developer.com/java/ejb/article.php/10931_3321521_1

Succeeding with Struts: Dynamically Allocated Forms
By James Turner
http://www.developer.com/java/ent/article.php/10933_3567701_1

Have fun!
Eric


-----Original Message-----
From:  news on behalf of Laurie Harper
Sent:  Wed 7/30/2008 4:53 PM
To:  user@(protected)
Cc:  
Subject:  Re: struts record output and entry

cpanon wrote:
> Hello
> I am having a difficult time designing and implementing an interaction of displaying and accepting user input of multiple records at once. I can create a collection of records, but records are complex, composed of other objects that are themselves composed of text strings that I want rendered as either simple html input boxes, checkboxes or radio. I have a sense that I need to use the iterate to get iterate over the total collection, but how do I record by record render the html input elements. Furthermore what do these look like to the action that will receive the post? A simpler version of this is being done on shopping carts a checkbox on each line, but that may be hard coded. Is the way I need it even possible with struts 1.1?


Without knowing anything about what your data structures look like, it's
hard to offer specific advice; are you working directly with record
sets? with business model classes persisted via JPA? etc.

At a high level, what you want to do is certainly possible. How easy it
will be will depend on what your data model looks like and whether you
have the flexibility to change it.

I would suggest you start out by reading up on how Struts manages the
mapping between model data and HTML forms, and especially how data
conversion works. Then build a simplified prototype that works with a
minimal data model and build up from there until you have something
representative of the end goal.

It will be easier to get help when you have specific questions you can ask.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)





Attachment: user_189508.ezm (zipped)
Thanks for your help.

Regards,
ManiKanta

Laurie Harper wrote:
> ManiKanta G wrote:
>> Hi,
>>
>> How can I redirect to another page after stream result. For example
>> redirecting to another page saying successfully downloaded the file
>> or adding some action message and redirecting to the same page.
>
> You can't; there can only be one response to an HTTP request. The same
> question was asked yesterday; see the thread 'ServletOutputStream' in
> the archives.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>



********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin@(protected)

Attachment: user_189520.ezm (zipped)
URL url=new URL(http://www.fubar.com);
string encoded_url = httpServletReponse.encodeRedirectURL(url);
httpServletResponse.sendRedirect(encoded_url);

Is there a reason why you would'nt want to use Struts prescribed method of
that is return a valid ActionForward via findMapping from
execute() method
actionMapping.findForward("error")

?
Martin-
----- Original Message -----
From: "ManiKanta G" <manikanta.gade@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, July 30, 2008 6:16 AM
Subject: Redirect after stream result


> Hi,
>
> How can I redirect to another page after stream result. For example
> redirecting to another page saying successfully downloaded the file or
> adding some action message and redirecting to the same page.
>
> Thanks in advance
>
> Regards,
> ManiKanta G
>
>
>
>
> ********** DISCLAIMER **********
> Information contained and transmitted by this E-MAIL is proprietary to
> Sify Limited and is intended for use only by the individual or entity to
> which it is addressed, and may contain information that is privileged,
> confidential or exempt from disclosure under applicable law. If this is a
> forwarded message, the content of this E-MAIL may not have been sent with
> the authority of the Company. If you are not the intended recipient, an
> agent of the intended recipient or a person responsible for delivering
> the
> information to the named recipient, you are notified that any use,
> distribution, transmission, printing, copying or dissemination of this
> information in any way or in any manner is strictly prohibited. If you
> have
> received this communication in error, please delete this mail & notify us
> immediately at admin@(protected)
>


Attachment: user_189521.ezm (zipped)
Hi,

I m using Struts2 (S2), not Struts1. In S2 there is a standard result
called 'stream' for downloading files. I m using that only.

Thanks any way.

Regards,
ManiKanta


Martin wrote:
> URL url=new URL(http://www.fubar.com);
> string encoded_url = httpServletReponse.encodeRedirectURL(url);
> httpServletResponse.sendRedirect(encoded_url);
>
> Is there a reason why you would'nt want to use Struts prescribed
> method of
> that is return a valid ActionForward via findMapping from
> execute() method
> actionMapping.findForward("error")
>
> ?
> Martin-
> ----- Original Message ----- From: "ManiKanta G"
> <manikanta.gade@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Wednesday, July 30, 2008 6:16 AM
> Subject: Redirect after stream result
>
>
>> Hi,
>>
>> How can I redirect to another page after stream result. For example
>> redirecting to another page saying successfully downloaded the file or
>> adding some action message and redirecting to the same page.
>>
>> Thanks in advance
>>
>> Regards,
>> ManiKanta G
>>
>>
>>
>>
>> ********** DISCLAIMER **********
>> Information contained and transmitted by this E-MAIL is proprietary to
>> Sify Limited and is intended for use only by the individual or entity to
>> which it is addressed, and may contain information that is privileged,
>> confidential or exempt from disclosure under applicable law. If this
>> is a
>> forwarded message, the content of this E-MAIL may not have been sent
>> with
>> the authority of the Company. If you are not the intended recipient, an
>> agent of the intended recipient or a person responsible for
>> delivering the
>> information to the named recipient, you are notified that any use,
>> distribution, transmission, printing, copying or dissemination of this
>> information in any way or in any manner is strictly prohibited. If
>> you have
>> received this communication in error, please delete this mail &
>> notify us
>> immediately at admin@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_189509.ezm (zipped)

Hai, can anybody help me to solve the problem javax.servlet.jsp.JspException:
Cannot retrieve mapping for action /pro.
if i replace the content in struts-config-product.xml to struts-config.xml.
it work. any idea???

web.xml

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/product</param-name>
<param-value>/WEB-INF/product/struts-config-product.xml</param-value>
</init-param>

struts-config-product.xml (product folder)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>

<!-- Data Sources -->
<data-sources>
</data-sources>

<!-- Form Beans -->
<form-beans>
<form-bean name="productForm" type="app.ProductForm"/>
</form-beans>

<!-- Global Exceptions -->
<global-exceptions>
</global-exceptions>

<!-- Global Forwards -->
<global-forwards>
</global-forwards>

<!-- Action Mappings -->
<action-mappings>
<action path="/pro"
type="app.ProductAction"
name="productForm"
scope="request">
<forward name="success" path="/success.html"/>
</action>
</action-mappings>

</struts-config>

ProductForm.java

package app;

import org.apache.struts.action.ActionForm;

public class ProductForm extends ActionForm{
private int id;

public int getId(){
return id;
}

public void setId(int id){
this.id=id;
}
}

ProductAction.java

package app;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class ProductAction extends Action{
public ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response){
ProductForm product=(ProductForm)form;
int iProduct=product.getId();
HttpSession session=request.getSession();
session.setAttribute("product",form);
return mapping.findForward("success");
}
}

thank you.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189524.ezm (zipped)
Are you deliberately using modules (if so, I have no idea--I always found them more trouble than they're worth)? If not you can just use a comma-separated list.

Dave


--- On Thu, 7/31/08, angelwei <goocheewei@(protected):

> From: angelwei <goocheewei@(protected)>
> Subject: Create multiple struts configuration file problem
> To: user@(protected)
> Date: Thursday, July 31, 2008, 1:48 AM
> Hai, can anybody help me to solve the problem
> javax.servlet.jsp.JspException:
> Cannot retrieve mapping for action /pro.
> if i replace the content in struts-config-product.xml to
> struts-config.xml.
> it work. any idea???
>
> web.xml
>
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>config/product</param-name>
> <param-value>/WEB-INF/product/struts-config-product.xml</param-value>
> </init-param>
>
> struts-config-product.xml (product folder)
>
> <?xml version="1.0"
> encoding="UTF-8"?>
> <!DOCTYPE struts-config PUBLIC "-//Apache Software
> Foundation//DTD Struts
> Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
> <struts-config>
>
> <!-- Data Sources -->
> <data-sources>
> </data-sources>
>
> <!-- Form Beans -->
> <form-beans>
> <form-bean name="productForm"
> type="app.ProductForm"/>
> </form-beans>
>
> <!-- Global Exceptions -->
> <global-exceptions>
> </global-exceptions>
>
> <!-- Global Forwards -->
> <global-forwards>
> </global-forwards>
>
> <!-- Action Mappings -->
> <action-mappings>
> <action path="/pro"
> type="app.ProductAction"
> name="productForm"
> scope="request">
> <forward name="success"
> path="/success.html"/>
> </action>
> </action-mappings>
>
> </struts-config>
>
> ProductForm.java
>
> package app;
>
> import org.apache.struts.action.ActionForm;
>
> public class ProductForm extends ActionForm{
> private int id;
>
> public int getId(){
> return id;
> }
>
> public void setId(int id){
> this.id=id;
> }
> }
>
> ProductAction.java
>
> package app;
>
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import javax.servlet.http.HttpSession;
>
> import org.apache.struts.action.Action;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionForward;
> import org.apache.struts.action.ActionMapping;
>
> public class ProductAction extends Action{
> public ActionForward perform(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request, HttpServletResponse response){
> ProductForm product=(ProductForm)form;
> int iProduct=product.getId();
> HttpSession session=request.getSession();
> session.setAttribute("product",form);
> return mapping.findForward("success");
> }
> }
>
> thank you.
> --
> View this message in context:
> http://www.nabble.com/Create-multiple-struts-configuration-file-problem-tp18748135p18748135.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_189511.ezm (zipped)

HI,
 How to configure struts 1.3 with eclipse 3.3.please help me regarding
this,it's little bit urgent.
 I am using following software's
Jdk1.6
Eclipse3.3
Tomcat6.0

or is there any related stuff please post me.

Thanks in Advance

BHBA
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189512.ezm (zipped)
I had the exact same problem.

Turns out it is a problem in dojo 0.4.0 that is shipped with struts2.
I include my own build of dojo to solve the problem.


kind regards
--
Markus Stauffer

On 7/31/08, nauke. <nauke0@(protected):
> Hi all,
>
> Was really not sure which mailing list to post to ...
>
> I have a java application that uses struts 2 (actions, etc).
> Every time I access a page (which goes through an action), my browser gets
> to that page, but then it "skips" (for want of a better term) onto a blank
> page (with the URL intact).
>
> I am using JBoss 4.2.2 GA.
>
> This problem only occurs with FireFox version 3.0.1 (the latest version).
> It does not occur with FireFox version 2.0.0.16, Internet Explorer or
> Safari.
>
> Has anyone had this problem?
>
> Cheers
>


--
Markus Stauffer

Attachment: user_189513.ezm (zipped)
ohh thank you thank you sooo much!
I'm about to go home now but I'll try it out first thing tomorrow and let
you all know how it went!

thanks again,
nicole

On Thu, Jul 31, 2008 at 4:57 PM, Markus Stauffer
<markus.stauffer@(protected):

> I had the exact same problem.
>
> Turns out it is a problem in dojo 0.4.0 that is shipped with struts2.
> I include my own build of dojo to solve the problem.
>
>
> kind regards
> --
> Markus Stauffer
>
> On 7/31/08, nauke. <nauke0@(protected):
> > Hi all,
> >
> > Was really not sure which mailing list to post to ...
> >
> > I have a java application that uses struts 2 (actions, etc).
> > Every time I access a page (which goes through an action), my browser
> gets
> > to that page, but then it "skips" (for want of a better term) onto a
> blank
> > page (with the URL intact).
> >
> > I am using JBoss 4.2.2 GA.
> >
> > This problem only occurs with FireFox version 3.0.1 (the latest version).
> > It does not occur with FireFox version 2.0.0.16, Internet Explorer or
> > Safari.
> >
> > Has anyone had this problem?
> >
> > Cheers
> >
>
>
> --
> Markus Stauffer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189514.ezm (zipped)

And I will explain why.
If I make any mistakes, please, tell me.
This is my struts2 tag:
<s:a id="AncorId"
    showLoadingText="false"
    targets="%{'linkattachedMainDocRow' + #document.count}"
    theme="ajax"
    href="%{#deleteDocumentAction}"
    notifyTopics="/afterDeleteLaw">
    Click me!
</s:a>
this is my JS code:
dojo.event.topic.subscribe("/afterDeleteLaw", _listeners, "test1");
var _listeners = {
 test1: function(sourceId){
          alert("sourceId");
    }
};

Do you know what will happen? I'll tell you. test(sourceId) will be invoked
twice.
The first time sourceId = id of dojo anchor widget (AncorId)
The second time sourceId = response text (text which my action returned).

This is amazing logic:
The first time you get widget, that sends request, the second time you get
response and you don't have any opportunity to determine, which anchor
recieved this response!

Imagine such situation:
Inside <s:iterator> you make several <s:a> widgets, you generate unique
<s:url> for them and id attribute.
User starts to click on widgets, they all start to send requests and receive
responses. As you know, JS in not thread safe, it means in a few seconds you
get terrible mix of widgets and responses inside subscribed topic.

I've spent three days trying to solve it, the right solution is: do not use
dojo anchor tag, use jQuery or your own custom ajax functions.

Please, take into consideration, it's extremely hard to get on with
listeners, I was lucky and got an idea of using listeners inside
google.code. I still don't understand how it works.

As I understand, the idea of ajax tags is to simplyfy the work, not to make
it as complicated, as possible.

RFC.

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189518.ezm (zipped)
Another option is to read the documentation, which indicates that the JavaScript function will be called twice (although it's better-stated in the 2.1 docs), once getting the id, and then again on success or error, with the HTML result.

http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-anchorTag

When you specify a handler you can use closure to include the ID of the widget you're creating the handler for, but that's a JS issue, not Struts. JS has a few major warts (yeah, thanks for binding "this" all goofy, JS) but it's very powerful when used with skill.

If you're interested in programming JS I'd recommend the Crockford videos. Well worth the time, and it'll improve your programming in other languages as well.

Dave


--- On Thu, 7/31/08, holod <serega.sheypak@(protected):

> From: holod <serega.sheypak@(protected)>
> Subject: <s:a dojo-anchor, seems like better not to use it and realize it yourself
> To: user@(protected)
> Date: Thursday, July 31, 2008, 4:16 AM
> And I will explain why.
> If I make any mistakes, please, tell me.
> This is my struts2 tag:
> <s:a id="AncorId"
>     showLoadingText="false"
>     targets="%{'linkattachedMainDocRow' +
> #document.count}"
>     theme="ajax"
>     href="%{#deleteDocumentAction}"
>     notifyTopics="/afterDeleteLaw">
>     Click me!
> </s:a>
> this is my JS code:
> dojo.event.topic.subscribe("/afterDeleteLaw",
> _listeners, "test1");
> var _listeners = {
>  test1: function(sourceId){
>            alert("sourceId");
>      }
> };
>
> Do you know what will happen? I'll tell you.
> test(sourceId) will be invoked
> twice.
> The first time sourceId = id of dojo anchor widget
> (AncorId)
> The second time sourceId = response text (text which my
> action returned).
>
> This is amazing logic:
> The first time you get widget, that sends request, the
> second time you get
> response and you don't have any opportunity to
> determine, which anchor
> recieved this response!
>
> Imagine such situation:
> Inside <s:iterator> you make several <s:a>
> widgets, you generate unique
> <s:url> for them and id attribute.
> User starts to click on widgets, they all start to send
> requests and receive
> responses. As you know, JS in not thread safe, it means in
> a few seconds you
> get terrible mix of widgets and responses inside subscribed
> topic.
>
> I've spent three days trying to solve it, the right
> solution is: do not use
> dojo anchor tag, use jQuery or your own custom ajax
> functions.
>
> Please, take into consideration, it's extremely hard to
> get on with
> listeners, I was lucky and got an idea of using listeners
> inside
> google.code. I still don't understand how it works.
>
> As I understand, the idea of ajax tags is to simplyfy the
> work, not to make
> it as complicated, as possible.
>
> RFC.
>
> --
> View this message in context:
> http://www.nabble.com/%3Cs%3Aa-dojo-anchor%2C-seems-like-better-not-to-use-it-and-realize-it-yourself-tp18749842p18749842.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_189515.ezm (zipped)
Thank you, Laurie!

But I'm going to switch to Struts 2 now so that issue is not so
important anymore.
Thanks anyway!

/Ylva

On Wed, Jul 30, 2008 at 11:11 PM, Laurie Harper <laurie@(protected):
> Ylva Degerfeldt wrote:
>>
>> Hi everyone,
>>
>> I'm using Struts 1.2 (bundled with NetBeans 5.5.1) and I've noticed
>> that I can't iterate through a java.util.Set using the logic:iterate
>> tag.
>> The code that I've tried:
>>
>> <logic:iterate collection = "skillsFound" id= "thisSkill" scope =
>> "session">
>>
>> I get this exception: javax.servlet.ServletException:
>> javax.servlet.jsp.JspException: Cannot create iterator for this
>> collection
>>
>> Does anyone know if this is a bug of Struts 1.2 and if there's a later
>> version (not Struts 2) where it's been fixed?
>>
>> I'd really appreciate an answer to this!
>>
>> Thanks in advance!
>>
>> /Ylva
>
> Sets are unordered, so I believe both Struts's iterate and JSTL forEach tags
> treat them as non-iterable, even though they do implement Collection. If you
> can expose skillsFound.iterator() as a scripting variable or page/request
> scoped attribute to pass into logic:iterate that might work.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189516.ezm (zipped)


Jeromy Evans - Blue Sky Minds wrote:
>
>
>> A short follow-up. Can you point me towards a description of where/when
>> the
>> Action object gets created and where Interceptors fit into the process.
>>
>
> The architect's guide is a good place to start.
>
> http://struts.apache.org/2.0.11.2/docs/big-picture.html
>
> There's nothing better than a good book though.
>
>

That's agreed!

What do you recommend? I have Kurniawan's "Struts 2 Design and Programming"
and Roughley's "Practical Apache Struts2 Web 2.0 projects" and "Starting
Struts 2". None of them go into any kind of detail about this section of
things (which is understandable since (a) it seems to be an edge case, (b)
it is a somewhat moving target and (c) the documentation on-line is 'less
than optimal')


Later,


Andy


--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189522.ezm (zipped)
Andy Law wrote:
>>
>> There's nothing better than a good book though.
>>
>>  
>
> That's agreed!
>
> What do you recommend? I have Kurniawan's "Struts 2 Design and Programming"
> and Roughley's "Practical Apache Struts2 Web 2.0 projects" and "Starting
> Struts 2". None of them go into any kind of detail about this section of
> things (which is understandable since (a) it seems to be an edge case, (b)
> it is a somewhat moving target and (c) the documentation on-line is 'less
> than optimal')
>
>  

True. The Struts 2 in Action book goes into the next level detail:

http://www.manning.com/dbrown/excerpt_contents.html

but still doesn't cover exactly what you're trying to do. I know others
works are in progress but not the details or schedules.

You may need to delve into the source near the DefaultActionMapper and
ParametersInterceptor variations to understand how it ties together.


Attachment: user_189528.ezm (zipped)


Jeromy Evans - Blue Sky Minds wrote:
>
>
> True. The Struts 2 in Action book goes into the next level detail:
>
> http://www.manning.com/dbrown/excerpt_contents.html
>
> but still doesn't cover exactly what you're trying to do. I know others
> works are in progress but not the details or schedules.
>
>

Thanks. I'll order that and see where it takes me (although it gets a
panning on Amazon UK - reviews on Amazon.com are more favourable).



Jeromy Evans - Blue Sky Minds wrote:
>
>
> You may need to delve into the source near the DefaultActionMapper and
> ParametersInterceptor variations to understand how it ties together.
>
>

Already been there all morning :o}

Thanks a lot for all the advice and discussion. It's been really helpful.

I think that - for now - I'm going with a straightforward wild-card mapping
coupled with a single-set property in the Action which appears in my
empirical testing to guard against "form parameter over-riding" of the
property.

The down-side is the configuration overhead. My separate actions have
distinct results so, although I have a dozen actions that need to share this
behaviour, I have to configure them separately to do it. If I build it later
into an Interceptor then I will be able to just add that to the default
interceptor stack for a package/packages so I may take that route at a later
date.

I *think* that sounds sensible, but I've stared at too much code, struts
'documentation' and Netbeans screens over the past few days to be sure.

Later,

Andy
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189517.ezm (zipped)

No one have any idea how to access session variable in jsp in this kind of
simple scenario ?

--
Milan


Milan Milanovic wrote:
>
> So, scenario is like this:
>
> MyFirstAction.method1 [put session variable] -> show first.jsp -> user
> click on link in first.jsp page -> show second.jsp -> user click on link
> in second.jsp -> MySecondAction.someMethod is called -> show third.jsp
> where this session test should be done.
>
> I hope this helps.
>
> --
> Thx, Milan
>
>
> Milan Milanovic wrote:
>>
>> Hi,
>>
>> just to note, I treid with this too: <s:if test="#session.your_variable
>> != null"> and it doesn't work.
>> I put my session variable in one action class, and then redirect to
>> another page which is connected to another action class. When that second
>> class method is runned, and resulting jsp is shown in that page I test
>> this. My both classes implements sessionAware.
>>
>> --
>> Milan
>>
>>
>>
>> Milan Milanovic wrote:
>>>
>>> Well, this : <s:if test="%{#session.your_variable != null}"> doesn't
>>> work, event though my class implements sessionAware and I put my
>>> your_variable in session before displaying this jsp page.
>>>
>>> I should note that I put that variable in one action class and then that
>>> <s:if> test is runned in jsp for another action class, but both classes
>>> implements sessionAware.
>>>
>>> What can I do ?
>>>
>>> --
>>> Thx, Milan
>>>
>>>
>>>
>>> felipe.lorenz wrote:
>>>>
>>>> Hummm.. Struts 1 or 2?
>>>>
>>>> This code is to S2.
>>>>
>>>> <s:if test="%{#session.your_variable != null}">
>>>>
>>>>   do something
>>>>
>>>> </s:if>
>>>>
>>>> I didnt test it, so im not sure about the code.
>>>>
>>>> But try it, and tell us.
>>>>
>>>> Felipe Lorenz
>>>>
>>>> On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
>>>> <milanmilanovich@(protected):
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I need to test in jsp if some session variable is present, and based
>>>>> on
>>>>> that
>>>>> to
>>>>> show some struts view code or not. How can I do that ?
>>>>>
>>>>> --
>>>>> Thx, Milan
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
>>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189523.ezm (zipped)
--- On Thu, 7/31/08, Milan Milanovic <milanmilanovich@(protected):
> No one have any idea how to access session variable in jsp
> in this kind of simple scenario ?

That's one explanation.

>> So, scenario is like this:
>> [...]

I am unable to duplicate the inability to test session variables for non-existence/null.

If I have an action implementing SessionAware (properly), set "foo1" into session, and do not set "foo2" into session, the following tests work:

<s:if test="#session.foo1 == null">
...
<s:if test="#session.foo2 != null">
...

They continue to work if I go through multiple actions using the exact same JSP to test for their presence/non-presence.

It is likely you are doing something wrong. I suppose that means you'll need to post the relevant SessionAware implementation, the code that sets the session variable(s), any action code in the application path that could modify session variables, the JSP that currently doesn't work, and any variants of the JSP code you've tried that also hasn't worked.

Dave


Attachment: user_189531.ezm (zipped)

Hi Dave,


newton.dave wrote:
>
> --- On Thu, 7/31/08, Milan Milanovic <milanmilanovich@(protected):
>> No one have any idea how to access session variable in jsp
>> in this kind of simple scenario ?
>
> That's one explanation.
>
>>> So, scenario is like this:
>>> [...]
>
> I am unable to duplicate the inability to test session variables for
> non-existence/null.
>
> If I have an action implementing SessionAware (properly), set "foo1" into
> session, and do not set "foo2" into session, the following tests work:
>
>  <s:if test="#session.foo1 == null">
>  ...
>  <s:if test="#session.foo2 != null">
>  ...
>
> They continue to work if I go through multiple actions using the exact
> same JSP to test for their presence/non-presence.
>

Yes, I tried with this, but session variable is not found.

I think that you didn't understand what is my scenario. I have implemented
SessionAware interface for both of my action classes and that works
perfectly in the case of jsp's that are connected to that classes.
But in this case, I have this:

MyFirstActionClass -> show first.jsp -> user click on link ->
MyFirstActionClass.method where I set session variable
(getSession().put("variable"); -> show second.jsp -> user click on some link
-> MySecondActionClass.method is called to return some results -> show
third.jsp with those results, and in this page I test if my session.variable
is present, but there is not !! But, my variables that are set in
MySecondActionClass.method are present in session for third.jsp!

What is the problem ?

--
Thx in advance, Milan



newton.dave wrote:
>
> It is likely you are doing something wrong. I suppose that means you'll
> need to post the relevant SessionAware implementation, the code that sets
> the session variable(s), any action code in the application path that
> could modify session variables, the JSP that currently doesn't work, and
> any variants of the JSP code you've tried that also hasn't worked.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189532.ezm (zipped)

It seems that my session variable is deleted somehow when first action method
of the second Action class is called:

MyFirstActionClass -> show first.jsp -> user click on link ->
MyFirstActionClass.method where I set session variable
(getSession().put("variable", new Boolean(true)); -> show second.jsp (here I
see my variable) -> user click on some link ->
MySecondActionClass.method->third.jsp (here I don't see my variable).

I should note that in MySecondActionClass.method I don't clear session or
something similar, I just add remove some other variables and set some new.

--
Thx, Milan


Milan Milanovic wrote:
>
> Hi Dave,
>
>
> newton.dave wrote:
>>
>> --- On Thu, 7/31/08, Milan Milanovic <milanmilanovich@(protected):
>>> No one have any idea how to access session variable in jsp
>>> in this kind of simple scenario ?
>>
>> That's one explanation.
>>
>>>> So, scenario is like this:
>>>> [...]
>>
>> I am unable to duplicate the inability to test session variables for
>> non-existence/null.
>>
>> If I have an action implementing SessionAware (properly), set "foo1" into
>> session, and do not set "foo2" into session, the following tests work:
>>
>>  <s:if test="#session.foo1 == null">
>>  ...
>>  <s:if test="#session.foo2 != null">
>>  ...
>>
>> They continue to work if I go through multiple actions using the exact
>> same JSP to test for their presence/non-presence.
>>
>
> Yes, I tried with this, but session variable is not found.
>
> I think that you didn't understand what is my scenario. I have implemented
> SessionAware interface for both of my action classes and that works
> perfectly in the case of jsp's that are connected to that classes.
> But in this case, I have this:
>
> MyFirstActionClass -> show first.jsp -> user click on link ->
> MyFirstActionClass.method where I set session variable
> (getSession().put("variable"); -> show second.jsp -> user click on some
> link -> MySecondActionClass.method is called to return some results ->
> show third.jsp with those results, and in this page I test if my
> session.variable is present, but there is not !! But, my variables that
> are set in MySecondActionClass.method are present in session for
> third.jsp!
>
> What is the problem ?
>
> --
> Thx in advance, Milan
>
>
>
> newton.dave wrote:
>>
>> It is likely you are doing something wrong. I suppose that means you'll
>> need to post the relevant SessionAware implementation, the code that sets
>> the session variable(s), any action code in the application path that
>> could modify session variables, the JSP that currently doesn't work, and
>> any variants of the JSP code you've tried that also hasn't worked.
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189525.ezm (zipped)
Hi guys,

  I am wondering if it's possible to modify the url format to get an
url of file format.

Current pattern:
www.myfunnyurl.com/namespace/actionname.action?param1=value1&param2=value2

I am looking for something like this:
www.myfunnyurl.com/namespace/actionname/value1/value2

Thanks,

--

*Pascal Lalonde
Programmeur Analyste*

------------------------------------------------------------------------

Attachment: user_189526.ezm (zipped)

Yes. I started my project with Tomcat in Netbeans and I have not set context.
The url look like:
http://localhost:8080/index.action

When I set namespace : namespace="/manager" the url look like:
http://localhost:8080/manager/indet.action

and the server return me HTTP Status 404.

Then I set context for Tomcat in Netbeans and it work perfect. The url then
look like:
http://localhost:8080/project/manager/indet.action

goodbye




Laurie Harper wrote:
>
> Leonidas Papadakis wrote:
>> Hi there,
>>
>> i've came across a very strange issue :
>>
>> i have developed an application locally on my pc (running only tomcat
>> 5.5.23) and then i deployed the application to an apache + tomcat under
>> a domain i.e. www.test.com
>>
>> I have set up a backoffice package at namespace "/backoffice". The
>> problem is that although i a can call an action when running the local
>> aplication at http://localhost:8080/app/backoffice/test.action, the same
>> under http://www.test.com/backoffice/test.action returns :
>>
>> HTTP Status 404 - /backoffice/test.action
>> type Status report
>> message /backoffice/test.action
>> description The requested resource (/backoffice/test.action) is not
>> available.
>> Apache Tomcat/5.5.23
>>
>> All the actions that are mapped to "/" are called fine ...
>>
>> I am really stack so i would appreciate your help ....
>>
>> Thank you very much
>>
>> Leonidas
>
> This sounds like a Tomcat configuration issue rather than a Struts
> issue. If you deploy the web app to the /app context, omitting the /app
> portion of the URL isn't going to work. To call the app with the URL you
> want, you'll need to deploy it to the ROOT context. You can achieve that
> with a deployment descriptor in the WAR file; check the Tomcat docs for
> details.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>


-----
Tomas Jurman
Czech Republic
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189527.ezm (zipped)

Did you substitute your custom provider in the xml declaration?

The default from struts-default.xml is:


  <bean type="com.opensymphony.xwork2.TextProvider" name="struts"
class="...TextProviderSupport" />


so you will need to plug your implementation.

Peace,
Scott



ayavorskiy wrote:
>
> Hi,
> Is there a way to substitute default, bundle-based TextProvider in Struts
> 2 with a custom one?
>
> We have a very custom message resolution needs with our Struts 2 based
> application. Per other posts and explanation from "Struts In Action",
> overriding of all getText methods in the base Action class does the trick
> for 90% of what we need. However, there is an issue around "Visitor
> validator" that apparently goes through a different path for error string
> resolution and does not call getText() methods on the action.
>
> Apparently, when model-driven Action design is used and <my
> model>-validation.xml is stored next to the model class, error messages
> (<message key="..." ../>) defined in validation XML get routed to the
> default TextProvider.
>
> Is there a way to plug in a custom Text Provider, system-wide? The
> TextProviderFactory makes it seem like custom provider is "injectable"
> (see below), but I have not been able to get it to ever "inject" anything.
> Seems like it always creates a new instance of TextProviderSupport()
> behind the scenes.
>
> Any help is much appreciated!!!
>
>  private TextProvider textProvider;
>
>   @Inject
>   public void setTextProvider(TextProvider textProvider) {
>      this.textProvider = textProvider;
>   }
>
>   protected TextProvider getTextProvider() {
>      if (this.textProvider == null) {
>         return new TextProviderSupport();
>      } else {
>         return textProvider;
>      }
>   }
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189529.ezm (zipped)

since using struts 2.1.2 my actions was three times
executed when i submit a form with dojo and <sx:submit>

Is this a bug, or a configuration error?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189533.ezm (zipped)
Hi Laurie

Thanks for the reply. I finally figured it out. Removing the
visitorFields pattern fixed the problem.

I'm guessing my combination of annotations is incorrect. So I had....

CLASS LEVEL
-----------
@Validation

Execute() method:
------------------------------------
  @Validations(visitorFields = {
    @VisitorFieldValidator(message = "Default message",
    fieldName = "surname",
    appendPrefix = false)
  })

setSurname() method:
------------------------------------
@RequiredStringValidator(message="Validation error",
key="validate.surname")

I'm guessing that I'm not supposed to use the visitorFields annotation
with the others. Was giving me some really strange behaviour. Will hunt
for some better examples...

Richard Gundersen
Java Developer

Email: richard.gundersen@(protected)
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-----Original Message-----
From: news [mailto:news@(protected)
Sent: Wednesday, July 30, 2008 10:18 PM
To: user@(protected)
Subject: Re: Wierd Validation

Gundersen, Richard wrote:
> Hi
>
> When validation succeeds on my form, I still get returned to the input
> page. My execute() method does not seem to be getting called even when
> validation is OK.
>
> This is my Action (no @Validation annotation after I read that was
> deprecated)
>
> =======================================================
>   @Validations(visitorFields = {
>      @VisitorFieldValidator(message = "Default message",
>      fieldName = "surname",
>      appendPrefix = false)
>   })
>   public String execute() {
>  ...
>
>
>   @RequiredStringValidator(message="Validation error",
> key="validate.surname")
>   public String getSurname() {
>      return surname;
>   }
>  ...
> =======================================================

Do you have a setSurname(String) method? Without it, Struts can't pass
the input data into your action.

> This is my struts.xml snippet, with the correct result attributes
>
>      <action name="login" method="execute" class="loginAction">
>         <result name="success" type="tiles">home</result>
>         <result name="input" type="tiles">welcome</result>
>      </action>  
>
> In the logs, when I enter an empty surname, I see "surname is invalid"
> when I expect. The same message is not in the logs when I enter a
valid
> value, so I would expect it to then drop into my 'execute' method. But
> it doesn't, it just returns to the 'input' page...
>
> Any ideas?

If you do have the setter in your action and you're getting this, do you

have any action errors/messages showing up when you get returned to the
input page?

L.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.

*** Disclaimer ***

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.


London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.

Subsidiary Companies:-

London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.

London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.

London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.

Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
©2008 gg3721.com - Jax Systems, LLC, U.S.A.