Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 14 Aug 2008 20:41:47 -0000 Issue 8193

user-digest-help

2008-08-14


Author LoginPost Reply

user Digest 14 Aug 2008 20:41:47 -0000 Issue 8193

Topics (messages 190019 through 190048):

problem with url tag when using portlets
 190019 by: cvx22
 190020 by: Nils-Helge Garli Hegvik

Re: Prepare method being invoked twice
 190021 by: Dave Newton
 190043 by: Kibo
 190044 by: Laurie Harper

Re: Struts + redirect=true + Apache Proxy Url Rewriting Problem
 190022 by: duschhaube
 190027 by: Miguel Cohnen

Multiple Images / InputStream
 190023 by: Pascal_
 190045 by: Laurie Harper
 190048 by: dynamicd

Hibernate UserType and OGNL
 190024 by: Kropp, Henning
 190025 by: Lukasz Lenart
 190028 by: Martin Gainty
 190032 by: Kropp, Henning

Struts2 Portlet - pre/post render, pre/post action hooks?
 190026 by: Torsten Krah

[S2] Result
 190029 by: stanlick.gmail.com
 190042 by: stanlick.gmail.com

Could not find property [struts.valueStack] using struts 2.1.2
 190030 by: "Stephan Schröder"

how to disable the back button in Struts 1.2.3 ?
 190031 by: Fernandes Celinio SGCF
 190046 by: Laurie Harper

[S2] Option for mandatory choice
 190033 by: Milan Milanovic
 190047 by: Laurie Harper

Problem with Struts2 tag
 190034 by: rajanikanth786.aol.com

Struts Authorization Interceptor
 190035 by: Relph,Brian
 190036 by: Frans Thamura

[S2]Validation with xml file not working
 190037 by: Ylva Degerfeldt
 190038 by: Lukasz Lenart
 190039 by: André Cedik | GDG
 190040 by: Ylva Degerfeldt

servlet-mapping to action servlet
 190041 by: temp temp

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_190019.ezm (zipped)

hi all,
i'm using struts 2.0.11.2 with portlets (Apache Pluto 1.1.5).

I have problem with struts url tag. I have something like this:
---------
<%@(protected)" %>
<%@(protected)"%>
[..]
<s:iterator value="%{menu}">
&lt;a href="<s:url action="%{url}"/>">link
</s:iterator>
[..]
---------
where '%{url}' is valid property.
in plain struts application value for action attribute is retrieved from
'url' property, but when run as portlet value is not read. In this case
invalid url is created.

how to do this in portlet?

thanks for help
artur,


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


Attachment: user_190020.ezm (zipped)
You're right, that is indeed a missing feature. Please register a JIRA
issue for this.

Nils-H

On Thu, Aug 14, 2008 at 1:29 PM, cvx22 <cvx22@(protected):
>
> hi all,
> i'm using struts 2.0.11.2 with portlets (Apache Pluto 1.1.5).
>
> I have problem with struts url tag. I have something like this:
> ---------
> <%@(protected)" %>
> <%@(protected)"%>
> [..]
> <s:iterator value="%{menu}">
> &lt;a href="<s:url action="%{url}"/>">link
> </s:iterator>
> [..]
> ---------
> where '%{url}' is valid property.
> in plain struts application value for action attribute is retrieved from
> 'url' property, but when run as portlet value is not read. In this case
> invalid url is created.
>
> how to do this in portlet?
>
> thanks for help
> artur,
>
>
> --
> View this message in context: http://www.nabble.com/problem-with-url-tag-when-using-portlets-tp18979825p18979825.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_190021.ezm (zipped)
--- On Thu, 8/14/08, Lukasz Lenart wrote:
> Just leave prepare() empty (you can also setup interceptor to don't
> call prepare() method) and implement prepare<YourMethod>()

IMO it's preferable to simply not implement prepare() rather than leave it blank (which is misleading).

Configuring a Preparable action's interceptors to not call prepare() it is borderline malicious, and at best confusing.

It'd be better to just fix the actual problem.

Dave


Attachment: user_190043.ezm (zipped)

Hi

When you see struts-default.xml, you find out that the
paramsPrepareParamsStack call the interceptor params twice.

You can set up your struts-default.xml or in struts.xml define your own
modified interceptor stack:

<struts>
  <package name="manager" namespace="/" extends="struts-default">
   
    <interceptors>          
       <interceptor-stack name="myStack">
          <interceptor-ref name="exception"/>
          <interceptor-ref name="servletConfig"/>
          <interceptor-ref name="params"/>
          <interceptor-ref name="prepare"/>
          <interceptor-ref name="checkbox"/>          
          <interceptor-ref name="conversionError"/>        
       </interceptor-stack>
    </interceptors>
         
    <default-interceptor-ref name="myStack" />
                   
    ...




---------------------------------------------------------------------
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_190044.ezm (zipped)
Kibo wrote:
> Hi
>
> When you see struts-default.xml, you find out that the
> paramsPrepareParamsStack call the interceptor params twice.
>
> You can set up your struts-default.xml or in struts.xml define your own
> modified interceptor stack:
>
> <struts>
>   <package name="manager" namespace="/" extends="struts-default">
>      
>      <interceptors>          
>         <interceptor-stack name="myStack">
>           <interceptor-ref name="exception"/>
>           <interceptor-ref name="servletConfig"/>
>           <interceptor-ref name="params"/>
>           <interceptor-ref name="prepare"/>
>           <interceptor-ref name="checkbox"/>          
>           <interceptor-ref name="conversionError"/>        
>         </interceptor-stack>
>      </interceptors>
>          
>      <default-interceptor-ref name="myStack" />
>                      
>      ...

I thought the problem was Prepare being called twice, not Params.
Anyway, there's no need to specify a custom stack to avoid having the
Params interceptor called twice; the default stack only calls it once.
The paramsPrepareParams stack is *intended* to call Params twice.

L.


Attachment: user_190022.ezm (zipped)
Hi,

I think you can handle this by the tomcat configuration.

see this link for instructions:
http://tomcat.apache.org/tomcat-6.0-doc/proxy-howto.html

but i have not test it myself.


Miguel Cohnen schrieb:
> Hi Everybody,
>
> First I wanted to say hello to everybody here, as this is my first mail in
> the list. I also wanted to apologize if my english is not good enough, but
> i'll do my best!
>
> This is the problem I am having:
>
> I am building an application using tomcat 5.5 and struts. Let's say that the
> base url form my application is http://myserver:8080/myapp. I have to use an
> Apache Proxy in front of my Tomcat Server (because of different reasons), so
> that my application can be reached using http://apacheserver/myapp (default
> port 80). I use such a rule in my Apache configuration fro rewriting urls:
> RewriteRule ^/myapp(.*) \http://myserver:8080/myapp$1 [P]
>
> It works perfect so that i can navigate through my application using
> http://apacheserver/myapp. But if using 'redirect=true' in one of my
> mappings,eg. after a form processing ends, the browser's url changes to
> http://myserver:8080/myapp ...
>
> How can i get rid of this? I need to keep on navigating through the proxy,
> but I also would like to use redirect=true...
>
> Thank you alot, and i hope someone can help me out. Below you can find some
> info about my environment:
>
> Apache Web Server 2.0
> Tomcat 5.5
> Struts 1.2.8
> Java 5
>


Attachment: user_190027.ezm (zipped)
It worked like a charm! You just need to add a special connector that handle
proxy requests like explained in the link below.

Thank you very very much!

On Thu, Aug 14, 2008 at 2:08 PM, duschhaube <duschhaube@(protected):

> Hi,
>
> I think you can handle this by the tomcat configuration.
>
> see this link for instructions:
> http://tomcat.apache.org/tomcat-6.0-doc/proxy-howto.html
>
> but i have not test it myself.
>
>
> Miguel Cohnen schrieb:
>
> Hi Everybody,
>>
>> First I wanted to say hello to everybody here, as this is my first mail in
>> the list. I also wanted to apologize if my english is not good enough, but
>> i'll do my best!
>>
>> This is the problem I am having:
>>
>> I am building an application using tomcat 5.5 and struts. Let's say that
>> the
>> base url form my application is http://myserver:8080/myapp. I have to use
>> an
>> Apache Proxy in front of my Tomcat Server (because of different reasons),
>> so
>> that my application can be reached using http://apacheserver/myapp(default
>> port 80). I use such a rule in my Apache configuration fro rewriting urls:
>> RewriteRule ^/myapp(.*) \http://myserver:8080/myapp$1 [P]
>>
>> It works perfect so that i can navigate through my application using
>> http://apacheserver/myapp. But if using 'redirect=true' in one of my
>> mappings,eg. after a form processing ends, the browser's url changes to
>> http://myserver:8080/myapp ...
>>
>> How can i get rid of this? I need to keep on navigating through the proxy,
>> but I also would like to use redirect=true...
>>
>> Thank you alot, and i hope someone can help me out. Below you can find
>> some
>> info about my environment:
>>
>> Apache Web Server 2.0
>> Tomcat 5.5
>> Struts 1.2.8
>> Java 5
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Un saludo,
Miguel Cohnen de la Cámara

Attachment: user_190023.ezm (zipped)

I'm using Struts 2.0.11 release.

Within my JSP page, I'm displaying a list of elements which all have an
image. Those images are displayed using an action with stream result.
In Firefox, everything works fine, in IE 7.0, all images shown are the same,
I didn't have a chance to take a look with IE 6.0.

Was not able to find anything in the wiki or forums about this.

In my JSP:

<s:url id="imageUrl" action="displayExerciceImageAction">
<s:param name="model.id">
 <s:property value="id"/>
</s:param>
</s:url>
<s:property value= " alt="<s:text name="exercice.form.image.alt"/>"
class="exerciceImg"/>

In my struts.xml

<action name="displayExerciceImageAction" class="displayExerciceAction">
<result name="success" type="stream">
 ${model.imageContentType}
 inline;filename="${model.name}"
 ${model.image.length}
</result>
</action>

In my action :

 /**
  * @return The image itself.
  */
 public InputStream getInputStream() {
    return new ByteArrayInputStream(model.getImage());
 }


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


Attachment: user_190045.ezm (zipped)
Pascal_ wrote:
> I'm using Struts 2.0.11 release.
>
> Within my JSP page, I'm displaying a list of elements which all have an
> image. Those images are displayed using an action with stream result.
> In Firefox, everything works fine, in IE 7.0, all images shown are the same,
> I didn't have a chance to take a look with IE 6.0.
>
> Was not able to find anything in the wiki or forums about this.
>
> In my JSP:
>
> <s:url id="imageUrl" action="displayExerciceImageAction">
> <s:param name="model.id">
>   <s:property value="id"/>
> </s:param>
> </s:url>
> <s:property value= " alt="<s:text name="exercice.form.image.alt"/>"
> class="exerciceImg"/>
>
> In my struts.xml
>
> <action name="displayExerciceImageAction" class="displayExerciceAction">
> <result name="success" type="stream">
>   ${model.imageContentType}
>   inline;filename="${model.name}"
>   ${model.image.length}
> </result>
> </action>
>
> In my action :
>
>   /**
>   * @return The image itself.
>   */
>   public InputStream getInputStream() {
>     return new ByteArrayInputStream(model.getImage());
>   }

Ignoring for now the fact your JSP sample doesn't have any img tags ;-)
I'd suggest checking for caching issues. You probably have no cache
control headers on the response from displayExerciceImageAction (or not
the right ones to make IE behave). Check the archives, I'm pretty sure
this has come up before.

L.


Attachment: user_190048.ezm (zipped)

Might be a caching issue

in the action pass something random as a param and see if it works like

<s:url id="imageUr1l"
value="/Something/displayExerciceImageAction.action?position=One">

for the next image

<s:url id="imageUrl2"
value="/Something/displayExerciceImageAction.action?position=Two">

etc..




Pascal_ wrote:
>
> I'm using Struts 2.0.11 release.
>
> Within my JSP page, I'm displaying a list of elements which all have an
> image. Those images are displayed using an action with stream result.
> In Firefox, everything works fine, in IE 7.0, all images shown are the
> same, I didn't have a chance to take a look with IE 6.0.
>
> Was not able to find anything in the wiki or forums about this.
>
> In my JSP:
>
> <s:url id="imageUrl" action="displayExerciceImageAction">
> <s:param name="model.id">
>   <s:property value="id"/>
> </s:param>
> </s:url>
> <s:property value= " alt="<s:text name="exercice.form.image.alt"/>"
> class="exerciceImg"/>
>
> In my struts.xml
>
> <action name="displayExerciceImageAction" class="displayExerciceAction">
> <result name="success" type="stream">
>   ${model.imageContentType}
>   inline;filename="${model.name}"
>   ${model.image.length}
> </result>
> </action>
>
> In my action :
>
>   /**
>   * @return The image itself.
>   */
>   public InputStream getInputStream() {
>     return new ByteArrayInputStream(model.getImage());
>   }
>
>
>

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


Attachment: user_190024.ezm (zipped)
Hi,

I am trying to implement a hibernate UserType for all the monetary
amounts in my application. I follow the example given in "Manning - Java
Persistence with Hibernate" Chapter 5.3 .
I am having difficulties to set and retrieve the value from a jsp due to
a lack of understanding how this is handled. I assume it is related to OGNL.

Basically I am trying the following:
addBid.jsp:
<s:textfield key="bid.amount" /> ( also tried: <s:textfield
key="bid.amount.amount" /> )

Mapping:
@org.hibernate.annotations.Type ( type=
"com.app.persistence.MonetaryUserType" )
@Column( name="amount" )
public Monetary getAmount() { return amount; }

and Monetary beeing:
public class Monetary implements Serializable{
  private final BigDecimal amount;
  private final Currency currency;

  public Monetary(BigDecimal amount, Currency currency) {
    this.amount = amount;
    this.currency = currency;
  }

  public BigDecimal getAmount() { return amount; }
  public Currency getCurrency() { return currency; }

I am getting either a field error or with "bid.amount.amount" :
ERROR [btpool0-2] InstantiatingNullHandler.nullPropertyValue(110) |
Could not create and/or set value back on to object
java.lang.InstantiationException: com.app.model.Monetary

What am I doing wrong? What is this
InstantiatingNullHandler.nullPropertyValue and how to trac it down?

Thanks and kind regards

Attachment: user_190025.ezm (zipped)
> ( also tried: <s:textfield> key="bid.amount.amount" /> )

This is correct

> public Monetary getAmount() { return amount; }
>
> and Monetary beeing:
> public class Monetary implements Serializable{
>  private final BigDecimal amount;
>  private final Currency currency;
>
>  public Monetary(BigDecimal amount, Currency currency) {
>     this.amount = amount;
>     this.currency = currency;
>  }
>
>  public BigDecimal getAmount() { return amount; }
>  public Currency getCurrency() { return currency; }
>
> I am getting either a field error or with "bid.amount.amount" :
> ERROR [btpool0-2] InstantiatingNullHandler.nullPropertyValue(110) | Could
> not create and/or set value back on to object
> java.lang.InstantiationException: com.app.model.Monetary

Add default constructor to Monetary and will be ok


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_190028.ezm (zipped)

Lukasz-
relvant doc located at
http://www.docjar.com/docs/api/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.html
what is the value of property named ReflectionContextState#CREATE_NULL_OBJECTS
?
so coding the constructor fixes the problem in which case your Null object is a simple bean as suggested here
If the null property is a simple bean with a no-arg constructor, it will simply be created using the ObjectFactory#buildBean(java.lang.Class, java.util.Map) method.?
dziekuje
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Thu, 14 Aug 2008 14:19:59 +0200
> From: lukasz.lenart@(protected)
> To: user@(protected)
> Subject: Re: Hibernate UserType and OGNL
>
> > ( also tried: <s:textfield> key="bid.amount.amount" /> )
>
> This is correct
>
> > public Monetary getAmount() { return amount; }
> >
> > and Monetary beeing:
> > public class Monetary implements Serializable{
> >  private final BigDecimal amount;
> >  private final Currency currency;
> >
> >  public Monetary(BigDecimal amount, Currency currency) {
> >     this.amount = amount;
> >     this.currency = currency;
> >  }
> >
> >  public BigDecimal getAmount() { return amount; }
> >  public Currency getCurrency() { return currency; }
> >
> > I am getting either a field error or with "bid.amount.amount" :
> > ERROR [btpool0-2] InstantiatingNullHandler.nullPropertyValue(110) | Could
> > not create and/or set value back on to object
> > java.lang.InstantiationException: com.app.model.Monetary
>
> Add default constructor to Monetary and will be ok
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Get Windows Live and get whatever you need, wherever you are. Start here.
http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home_082008

Attachment: user_190032.ezm (zipped)
Lukasz Lenart schrieb:
>> ( also tried: <s:textfield> key="bid.amount.amount" /> )
>>  
>
> This is correct
>
>  
>> public Monetary getAmount() { return amount; }
>>
>> and Monetary beeing:
>> public class Monetary implements Serializable{
>>  private final BigDecimal amount;
>>  private final Currency currency;
>>
>>  public Monetary(BigDecimal amount, Currency currency) {
>>     this.amount = amount;
>>     this.currency = currency;
>>  }
>>
>>  public BigDecimal getAmount() { return amount; }
>>  public Currency getCurrency() { return currency; }
>>
>> I am getting either a field error or with "bid.amount.amount" :
>> ERROR [btpool0-2] InstantiatingNullHandler.nullPropertyValue(110) | Could
>> not create and/or set value back on to object
>> java.lang.InstantiationException: com.app.model.Monetary
>>  
>
> Add default constructor to Monetary and will be ok
>
>
> Regards
>  
And one should give the Monetary proper setters..... stupid me ;)

Works! Thank you!

Attachment: user_190026.ezm (zipped)
Hi.
I am wondering if it is possible to hook into the render and action phase of
the portlet execution?
If there is not yet such a possibility, where to look for to do this
(something like extending dispatcher portlet ... anything else).


--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
 -- Linus Torvalds

Attachment: smime.p7s (zipped)
Attachment: user_190029.ezm (zipped)
I am trying to retrofit the Ajax JSP Tag Library server side *servlet *code
to fit the S2 lifecycle. I have a particular situation where my custom
result works if I:

     PrintWriter pw = response.getWriter();
     pw.write(request.getParameter(blah, blah, blah);
     pw.close();

but does not when using :

    RequestDispatcher dispatcher =
request.getRequestDispatcher(getLocation());
    dispatcher.include(request, response);

Shouldn't the .include write to the response in much the same way?

Peace,
Scott

Attachment: user_190042.ezm (zipped)
Worked fine using dispatcher.forward(request, response);

On Thu, Aug 14, 2008 at 8:23 AM, <stanlick@(protected):

> I am trying to retrofit the Ajax JSP Tag Library server side *servlet *code
> to fit the S2 lifecycle. I have a particular situation where my custom
> result works if I:
>
>       PrintWriter pw = response.getWriter();
>       pw.write(request.getParameter(blah, blah, blah);
>       pw.close();
>
> but does not when using :
>
>      RequestDispatcher dispatcher =
> request.getRequestDispatcher(getLocation());
>      dispatcher.include(request, response);
>
> Shouldn't the .include write to the response in much the same way?
>
> Peace,
> Scott
>
>
>

Attachment: user_190030.ezm (zipped)
hi,

this is my first post to the mailing list so i hope this is the right place/email address.

I wrote a 'hello world'-application using struts 2.1.2 using freemarker-result.
The application works fine but the following warnings are displayed:

INFO: Server startup in 757 ms
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [struts.valueStack]
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [.freemarker.Request]
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [.freemarker.RequestParameters]

Did i miss something?

You can download the war-file here:
http://www.file-upload.net/download-1042786/helloworld.war.html

regards,
Stephan
--
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

Attachment: user_190031.ezm (zipped)
Hi,
I want to forbid the user to go back.

Javascript does not work in actions:

<script language="JavaScript">
 window.history.forward(1);
</script>


Is there a way to disable the back button in Struts ?
Thanks



=========================================================

Ce message et toutes les pieces jointes (ci-apres le "message")
sont confidentiels et susceptibles de contenir des informations
couvertes par le secret professionnel. Ce message est etabli
a l'intention exclusive de ses destinataires. Toute utilisation
ou diffusion non autorisee interdite.
Tout message electronique est susceptible d'alteration. La SOCIETE GENERALE
et ses filiales declinent toute responsabilite au titre de ce message
s'il a ete altere, deforme falsifie.

=========================================================

This message and any attachments (the "message") are confidential,
intended solely for the addressees, and may contain legally privilegedxi
information. Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any
of its subsidiaries or affiliates shall be liable for the message
if altered, changed or falsified.

=========================================================

Attachment: user_190046.ezm (zipped)
Fernandes Celinio SGCF wrote:
> Hi,
> I want to forbid the user to go back.
>
> Javascript does not work in actions:

Well, obviously; Javascript runs on the client, actions run on the server.

> <script language="JavaScript">
>   window.history.forward(1);
> </script>
>
> Is there a way to disable the back button in Struts ?
> Thanks

That code should work as you expect as long as it is included on the
page you want to disable the back button for. However, that's generally
a bad thing to do from a usability perspective; users expect their back
buttons to work unimpeded.

I would suggest re-examining the requirement that led you to disabling
the back button, and addressing it in a way that allows the back button
to function normally.

L.


Attachment: user_190033.ezm (zipped)

Hi,

I have class structure as follows:

class Store {
 List<Fruit> fruits;
 Fruit choosenFruit;
}

So, I need in my jsp to represent fruits, but one of those fruits must be
choosen any time (in choosenFruit object, which select one Fruit object from
fruits list) during user input, e.g. when first Fruit is in the list it must
be selected as "choosen", and when other Fruits are put in this list, user
can choose some else Fruit, like this:

Fruits
====================================
| Name    |     SomeValue   |   Default  |
====================================
| Apple    |      5           |           |
----------------------------------------------
| Blueberry |      3           |     *     |
----------------------------------------------

I'm thinking maybe about radio tag to use for this ? Any hint, is it
possible ?

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


Attachment: user_190047.ezm (zipped)
Milan Milanovic wrote:
> Hi,
>
> I have class structure as follows:
>
> class Store {
>   List<Fruit> fruits;
>   Fruit choosenFruit;
> }
>
> So, I need in my jsp to represent fruits, but one of those fruits must be
> choosen any time (in choosenFruit object, which select one Fruit object from
> fruits list) during user input, e.g. when first Fruit is in the list it must
> be selected as "choosen", and when other Fruits are put in this list, user
> can choose some else Fruit, like this:
>
> Fruits
> ====================================
> | Name    |     SomeValue   |   Default  |
> ====================================
> | Apple    |      5           |           |
> ----------------------------------------------
> | Blueberry |      3           |     *     |
> ----------------------------------------------
>
> I'm thinking maybe about radio tag to use for this ? Any hint, is it
> possible ?

A radio button for each row, bound to the chosenFruit property (or, more
likely, too chosenFruit.id or something) ought to do the trick. Have you
tried it?

L.


Attachment: user_190034.ezm (zipped)

Hi,





In <sx:autocompleter> tag in struts2, i am unable to call any javascript event(functions).





for example,


<sx:autocompleter list="practiceList" name="emailList" onclick ="getData();"/>






and in the getData() function i am just checking with one alert message.






I want to know whether any javascript function we can use for <sx:autocompleter>.








Thanks & Regards,


RajaniKanth Teppala.


rajanikanth786@(protected)

Attachment: user_190035.ezm (zipped)

Hello,

I have recently integrated my struts2 apps with spring security for authentication. We use an implementation CAS for single-sign-in/out. I am now looking to add authorization, and I was wondering if anyone had implemented an authorization interceptor with spring-security, and how that turned out. I am looking for both action and method level authorization.

Thanks,

Brian Relph

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

Attachment: user_190036.ezm (zipped)
On Thu, Aug 14, 2008 at 10:38 PM, Relph,Brian <Brian.Relph@(protected):
>
> Hello,
>
> I have recently integrated my struts2 apps with spring security for authentication. We use an implementation CAS for single-sign-in/out. I am now looking to add authorization, and I was wondering if anyone had implemented an authorization interceptor with spring-security, and how that turned out. I am looking for both action and method level authorization.


can share the code?

can share also the filter for the action in Spring SEcurity

i still dont know, to filter the url action, like CRUD in this model

thx

Attachment: user_190037.ezm (zipped)
Hi everyone,

I'm trying to use the Validation framework by creating a file called
NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
it's not working the way it should.
I've stepped through the code and it seems that the validations that
should have been made through the xml file just don't happen.

When, for instance, I've tried to deliberately leave some fields empty
(which the validator should have noticed), the execute method is still
invoked. This shouldn't happen when there are validation errors,
right?

I've put the validation xml file in the same directory (and package)
as the corresponding action, but it seems that Struts 2 can't find it
anyway. What am I doing wrong?

This is the declaration of my action in struts.xml:
.....
<action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
       <result>/showSkills.jsp</result>
       <result name = "input">/NameAndCv.jsp</result>
</action>
....
(This belongs to a package that extends struts-default)

By the way, I'm also using simple validation which works without
problems. (But I'd like to know how to use the validation framework
"the harder way" too.)

Can somebody please help me?

Thanks in advance!

/Ylva

Attachment: user_190038.ezm (zipped)
Did you check also the deployment, on the server? Eclipse will not
copy other files then Java classes when you will deploy. Check if xml
file is in the same package after deploy to the server.


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_190039.ezm (zipped)
Maybe it's just because of the misspelling.
If you'd like to do validation this way,
your xml-file should be named
"NameAndCvAction-validation.xml" without
the "s" at the end.


Ylva Degerfeldt wrote:
> Hi everyone,
>
> I'm trying to use the Validation framework by creating a file called
> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
> it's not working the way it should.
> I've stepped through the code and it seems that the validations that
> should have been made through the xml file just don't happen.
>
> When, for instance, I've tried to deliberately leave some fields empty
> (which the validator should have noticed), the execute method is still
> invoked. This shouldn't happen when there are validation errors,
> right?
>
> I've put the validation xml file in the same directory (and package)
> as the corresponding action, but it seems that Struts 2 can't find it
> anyway. What am I doing wrong?
>
> This is the declaration of my action in struts.xml:
> .....
> <action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
>         <result>/showSkills.jsp</result>
>         <result name = "input">/NameAndCv.jsp</result>
> </action>
> ....
> (This belongs to a package that extends struts-default)
>
> By the way, I'm also using simple validation which works without
> problems. (But I'd like to know how to use the validation framework
> "the harder way" too.)
>
> Can somebody please help me?
>
> Thanks in advance!
>
> /Ylva
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_190040.ezm (zipped)
Lukasz, I'm not sure how to check the deployment but I was thinking
that too. (I'm using NetBeans 5.5.1 and Sun App. server.)

André, it's funny you should mention that because I just changed the
name From .....-validation.xml to ....-validations.xml because they
must have misspelled it in one place in the "Struts 2 in Action" book,
so I thought that was the correct way since the name without the s
gives me this exception:

java.lang.IllegalArgumentException: URI is not hierarchical

At least I know it has nothing to do with that I'm uploading a file
from a form, 'cause that part works fine. It's something about the
validation. What could it be?

/y

On Thu, Aug 14, 2008 at 6:04 PM, André Cedik | GDG
<a.cedik@(protected):
> Maybe it's just because of the misspelling.
> If you'd like to do validation this way,
> your xml-file should be named
> "NameAndCvAction-validation.xml" without
> the "s" at the end.
>
>
> Ylva Degerfeldt wrote:
>> Hi everyone,
>>
>> I'm trying to use the Validation framework by creating a file called
>> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
>> it's not working the way it should.
>> I've stepped through the code and it seems that the validations that
>> should have been made through the xml file just don't happen.
>>
>> When, for instance, I've tried to deliberately leave some fields empty
>> (which the validator should have noticed), the execute method is still
>> invoked. This shouldn't happen when there are validation errors,
>> right?
>>
>> I've put the validation xml file in the same directory (and package)
>> as the corresponding action, but it seems that Struts 2 can't find it
>> anyway. What am I doing wrong?
>>
>> This is the declaration of my action in struts.xml:
>> .....
>> <action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
>>         <result>/showSkills.jsp</result>
>>         <result name = "input">/NameAndCv.jsp</result>
>> </action>
>> ....
>> (This belongs to a package that extends struts-default)
>>
>> By the way, I'm also using simple validation which works without
>> problems. (But I'd like to know how to use the validation framework
>> "the harder way" too.)
>>
>> Can somebody please help me?
>>
>> Thanks in advance!
>>
>> /Ylva
>>
>> ---------------------------------------------------------------------
>> 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_190041.ezm (zipped)
how can map all request to struts action servlet ?
will this work

<url-pattern>/*</url-pattern>




   
©2008 gg3721.com - Jax Systems, LLC, U.S.A.