Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 28 Jul 2008 10:02:38 -0000 Issue 8163

user-digest-help

2008-07-28


Author LoginPost Reply

user Digest 28 Jul 2008 10:02:38 -0000 Issue 8163

Topics (messages 189342 through 189371):

Re: Data Leakage in Struts 2
 189342 by: Miguel
 189343 by: Piero Sartini
 189344 by: Miguel
 189345 by: dusty
 189346 by: Arun M
 189347 by: Arun M
 189348 by: Arun M
 189349 by: Arun M

Re: user-frendly urls in struts2
 189350 by: lei.java.gmail.com
 189352 by: Chris Pratt
 189354 by: Piero Sartini
 189355 by: lei.java.gmail.com

[S2] JSP pages not showing error/debug info
 189351 by: Ramanathan RV

Re: s:include tag and s:param
 189353 by: Eric D Nielsen
 189356 by: Dave Newton
 189364 by: Dave Newton

Re: [S2] Form doesn't redirect
 189357 by: Milan Milanovic
 189358 by: Dave Newton

[S2] getting other action URL from within an action
 189359 by: Pierre Thibaudeau

[S2} REST plugin & Security
 189360 by: Mike Watson
 189361 by: Mike Watson

Re: how to fix Validation isses in a wizard application + Train
 189362 by: ravi_eze

Is it possible not to use DOJO plugin?
 189363 by: holod

Iterator index: how to index html elements?
 189365 by: holod
 189366 by: Joachim Ansorg
 189367 by: Dave Newton
 189368 by: holod

Re: Iterator index: how to index html elements? count works, but status doesn't
 189369 by: holod

Compose String value and stack value into String, set result as property value of struts2 tag
 189370 by: holod

Re: Compose String value and stack value into String, set result as property value of struts2 tag, solution
 189371 by: holod

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_189342.ezm (zipped)
Be shure that your web beans are marked scope="propotype" in the
spring configuration files; that makes spring create a new bean each
time you need one instead of providing a pointer to the existing
instance.
Spring defaults to singletons so don't mark prototype things like DAOs
or service classes that don't have persistence state between methods.


Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.



On Sat, Jul 26, 2008 at 23:04, Arun M <marunkumar10@(protected):
>
> Yes , we are using spring and hibernate also along with struts.
> Could you suggest us, where to configure to resue the beans ??
>
>
> Piero Sartini-3 wrote:
>>
>> Struts2 does create a new Action for every request.
>> Do you use Spring? I think you can configure it to reuse the beans...
>>
>>     Piero
>>
>> Am Samstag, 26. Juli 2008 19:48:47 schrieb Arun M:
>>> We are using struts 2.0.11
>>>
>>> We have lots of action class. Say one of them is CustomerRegisterAction
>>> (which extends ActionSupport ) . When a say user X registers himself on
>>> the website; this CustomerRegisterAction is populated (using OGNL) and
>>> the
>>> customer data is saved to DB. But after sometime some other user Y from
>>> some other PCcomes and clicks the Register link, then the data entered by
>>> X
>>> is prefilled now.
>>>   I think the CustomerRegisterAction is reused, instead of creating new
>>> instance every request. we want to setup such that new
>>> CustomerRegisterAction is created every httprequest, so that data is not
>>> leaking between users.
>>>
>>> Please help us.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Data-Leakage-in-Struts-2-tp18669314p18673188.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_189343.ezm (zipped)
Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
> Yes , we are using spring and hibernate also along with struts.
> Could you suggest us, where to configure to resue the beans ??

The spring plugin is described in detail at
http://struts.apache.org/2.x/docs/spring-plugin.html
I am not using spring and do not know it very well.

If you do not create your action with struts2 but with Spring, try s.th. like
<bean id="bar" class="com.my.BarAction" singleton="false"/>
oin your applicationContext.xml

 Piero

Attachment: user_189344.ezm (zipped)
Well, the question is if you are using Spring 1.x or 2.x and creating
spring beans (using the spring plugin and in your struts.xml using the
spring bean name instead of the full class name):
If you are using the 1.x version, do as said by Piero Sartini
(singleton="false") in your application-context.xml
If you are using the 2.x version use scope="prototype" in your
application-context.xml

If you are not using the spring plugin or using the spring object
factory to autowire the beans (via the autowire by name or type of the
spring plugin configured in struts.xml), you can allways create a
preparable bean (implements Preparable) and in the prepare() method,
clear what you need; or you can additionally use the
ParamsPrepareParams stack to do more complicated stuff.

Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.



On Sat, Jul 26, 2008 at 23:21, Piero Sartini <lists@(protected):
> Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
>> Yes , we are using spring and hibernate also along with struts.
>> Could you suggest us, where to configure to resue the beans ??
>
> The spring plugin is described in detail at
> http://struts.apache.org/2.x/docs/spring-plugin.html
> I am not using spring and do not know it very well.
>
> If you do not create your action with struts2 but with Spring, try s.th. like
> <bean id="bar" class="com.my.BarAction" singleton="false"/>
> oin your applicationContext.xml
>
>     Piero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189345.ezm (zipped)

I think you need to post the relevant section from struts.xml so we can see
how you declare the action as well as your spring configuration files.

-D


Miguel-55 wrote:
>
> Well, the question is if you are using Spring 1.x or 2.x and creating
> spring beans (using the spring plugin and in your struts.xml using the
> spring bean name instead of the full class name):
> If you are using the 1.x version, do as said by Piero Sartini
> (singleton="false") in your application-context.xml
> If you are using the 2.x version use scope="prototype" in your
> application-context.xml
>
> If you are not using the spring plugin or using the spring object
> factory to autowire the beans (via the autowire by name or type of the
> spring plugin configured in struts.xml), you can allways create a
> preparable bean (implements Preparable) and in the prepare() method,
> clear what you need; or you can additionally use the
> ParamsPrepareParams stack to do more complicated stuff.
>
> Si quieres ser más positivo, pierde un electrón
> Miguel Ruiz Velasco S.
>
>
>
> On Sat, Jul 26, 2008 at 23:21, Piero Sartini <lists@(protected)>
> wrote:
>> Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
>>> Yes , we are using spring and hibernate also along with struts.
>>> Could you suggest us, where to configure to resue the beans ??
>>
>> The spring plugin is described in detail at
>> http://struts.apache.org/2.x/docs/spring-plugin.html
>> I am not using spring and do not know it very well.
>>
>> If you do not create your action with struts2 but with Spring, try s.th.
>> like
>> <bean id="bar" class="com.my.BarAction" singleton="false"/>
>> oin your applicationContext.xml
>>
>>     Piero
>>
>> ---------------------------------------------------------------------
>> 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)
>
>
>

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


Attachment: user_189346.ezm (zipped)


we use STRUTS2 - SPRING- HIBERNATE in our project
here is a sample piece of code...
as metioned earlier... SCRAPTEXT variable once set by a request is being
reused (that is) gets prefilled in the
textarea of someother user in someother PC.

............. Action Class ----------------------------
public class SocialDetailAction extends
com.opensymphony.xwork2.ActionSupport{
 
  private com.jujubi.services.ProductService productService;
   
 
  private String scrapText;
  private int toId;
  private String scrapFromName;
  private boolean secure;
   
 

  public String postCustomerScrap() throws Exception {
   
      /*****
    ....
     
     // HERE WE HAVE THE CODE THAT USES THE GETTER SETTER OF THE MEMEBERS
    ...
     return SUCCESS;

   }
}




//GETTER SETTTER FOR THE MEMBERS

}



------------ jSP ----------------------------
.......
....
..
                <s:form namespace="/jap" action="scrappost">
         <s:textarea name="scrapText" cols="60" rows="3"/>
     <s:checkbox name="secure" label="secure" value="false"></s:checkbox>
     <s:submit value="post scrap" theme="ajax" targets="addScrap" />
     </s:form>
.........
.....
...

----------------------- Struts.xml for the action -----------------------

..
.

   <action name="scrappost" class="socialDetailAction"
method="postCustomerScrap">
     <result name="success">/views/social/ReturnMsg.jsp</result>
     <result name="input">/views/social/PeopsScrapbook.jsp</result>
   </action>  

...
..





Richard Yee wrote:
>
> Why don't you post your code. It seems that it might have a threading
> issue.
>
> -R
>
> Arun M wrote:
>> We are using struts 2.0.11
>>
>> We have lots of action class. Say one of them is CustomerRegisterAction
>> (which extends ActionSupport ) . When a say user X registers himself on
>> the website; this CustomerRegisterAction is populated (using OGNL) and
>> the
>> customer data is saved to DB. But after sometime some other user Y from
>> some
>> other PCcomes and clicks the Register link, then the data entered by X is
>> prefilled now.
>>   I think the CustomerRegisterAction is reused, instead of creating new
>> instance every request. we want to setup such that new
>> CustomerRegisterAction is created every httprequest, so that data is not
>> leaking between users.
>>
>> Please help us.
>>  
>
>
> ---------------------------------------------------------------------
> 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_189347.ezm (zipped)

Thanks a lot...

We included singleton="false" in the applicationContext.xml
Now it works perfectly ...

Thanks Once Again


Piero Sartini-3 wrote:
>
> Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
>> Yes , we are using spring and hibernate also along with struts.
>> Could you suggest us, where to configure to resue the beans ??
>
> The spring plugin is described in detail at
> http://struts.apache.org/2.x/docs/spring-plugin.html
> I am not using spring and do not know it very well.
>
> If you do not create your action with struts2 but with Spring, try s.th.
> like
> <bean id="bar" class="com.my.BarAction" singleton="false"/>
> oin your applicationContext.xml
>
>  Piero
>
> ---------------------------------------------------------------------
> 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_189348.ezm (zipped)

Thanks a lot...

We included singleton="false" in the applicationContext.xml
Now it works perfectly ...


Arun M wrote:
>
>
> we use STRUTS2 - SPRING- HIBERNATE in our project
> here is a sample piece of code...
> as metioned earlier... SCRAPTEXT variable once set by a request is being
> reused (that is) gets prefilled in the
> textarea of someother user in someother PC.
>
> ............. Action Class ----------------------------
> public class SocialDetailAction extends
> com.opensymphony.xwork2.ActionSupport{
>  
>   private com.jujubi.services.ProductService productService;
>    
>  
>   private String scrapText;
>   private int toId;
>   private String scrapFromName;
>   private boolean secure;
>    
>  
>
>   public String postCustomerScrap() throws Exception {
>    
>         /*****
>     ....
>      
>      // HERE WE HAVE THE CODE THAT USES THE GETTER SETTER OF THE MEMEBERS
>     ...
>      return SUCCESS;
>
>    }
> }
>
>
>
>
> //GETTER SETTTER FOR THE MEMBERS
>
> }
>
>
>
> ------------ jSP ----------------------------
> .......
> ....
> ..
>                 <s:form namespace="/jap" action="scrappost">
>          <s:textarea name="scrapText" cols="60" rows="3"/>
>      <s:checkbox name="secure" label="secure" value="false"></s:checkbox>
>      <s:submit value="post scrap" theme="ajax" targets="addScrap" />
>      </s:form>
> .........
> .....
> ...
>
> ----------------------- Struts.xml for the action -----------------------
>
> ..
> .
>
>    <action name="scrappost" class="socialDetailAction"
> method="postCustomerScrap">
>      <result name="success">/views/social/ReturnMsg.jsp</result>
>      <result name="input">/views/social/PeopsScrapbook.jsp</result>
>    </action>  
>
> ...
> ..
>
>
>
>
>
> Richard Yee wrote:
>>
>> Why don't you post your code. It seems that it might have a threading
>> issue.
>>
>> -R
>>
>> Arun M wrote:
>>> We are using struts 2.0.11
>>>
>>> We have lots of action class. Say one of them is CustomerRegisterAction
>>> (which extends ActionSupport ) . When a say user X registers himself
>>> on
>>> the website; this CustomerRegisterAction is populated (using OGNL) and
>>> the
>>> customer data is saved to DB. But after sometime some other user Y from
>>> some
>>> other PCcomes and clicks the Register link, then the data entered by X
>>> is
>>> prefilled now.
>>>   I think the CustomerRegisterAction is reused, instead of creating new
>>> instance every request. we want to setup such that new
>>> CustomerRegisterAction is created every httprequest, so that data is not
>>> leaking between users.
>>>
>>> Please help us.
>>>  
>>
>>
>> ---------------------------------------------------------------------
>> 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_189349.ezm (zipped)

Thanks a lot...

We included singleton="false" in the applicationContext.xml
Now it works perfectly ...



dusty wrote:
>
> I think you need to post the relevant section from struts.xml so we can
> see how you declare the action as well as your spring configuration files.
>
> -D
>
>
> Miguel-55 wrote:
>>
>> Well, the question is if you are using Spring 1.x or 2.x and creating
>> spring beans (using the spring plugin and in your struts.xml using the
>> spring bean name instead of the full class name):
>> If you are using the 1.x version, do as said by Piero Sartini
>> (singleton="false") in your application-context.xml
>> If you are using the 2.x version use scope="prototype" in your
>> application-context.xml
>>
>> If you are not using the spring plugin or using the spring object
>> factory to autowire the beans (via the autowire by name or type of the
>> spring plugin configured in struts.xml), you can allways create a
>> preparable bean (implements Preparable) and in the prepare() method,
>> clear what you need; or you can additionally use the
>> ParamsPrepareParams stack to do more complicated stuff.
>>
>> Si quieres ser más positivo, pierde un electrón
>> Miguel Ruiz Velasco S.
>>
>>
>>
>> On Sat, Jul 26, 2008 at 23:21, Piero Sartini <lists@(protected)>
>> wrote:
>>> Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
>>>> Yes , we are using spring and hibernate also along with struts.
>>>> Could you suggest us, where to configure to resue the beans ??
>>>
>>> The spring plugin is described in detail at
>>> http://struts.apache.org/2.x/docs/spring-plugin.html
>>> I am not using spring and do not know it very well.
>>>
>>> If you do not create your action with struts2 but with Spring, try s.th.
>>> like
>>> <bean id="bar" class="com.my.BarAction" singleton="false"/>
>>> oin your applicationContext.xml
>>>
>>>     Piero
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>>
>>
>>
>
>

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


Attachment: user_189350.ezm (zipped)
Hi,

I have an action which can be reached by

 - http://<hostname>/friends/viewpix.action


 - http://<hostname>/friends/viewpix.action?id=2222


My client doesn't want the *.action* to appear in the urls so is there a way
to launch the action by using friendly urls, e.g., like these:


 - http://<hostname>/friends/viewpix
 - http://<hostname>/friends/viewpix?id=2222.


Thanks.

Attachment: user_189352.ezm (zipped)
You might want to look into the RESTful URL's plugin. But you can
just override the extension. I usually set mine to .html (to hide the
technology being used), but I believe you can set it no nothing as
well. I use the following in struts.xml, I believe you can set the
value to "" also.

<constant name="struts.action.extension" value="html"/>

You'll also have to change the servlet-mapping in web.xml to match.
(*Chris*)

On Sun, Jul 27, 2008 at 9:27 AM, lei.java@(protected):
> Hi,
>
> I have an action which can be reached by
>
>  - http://<hostname>/friends/viewpix.action
>
>
>  - http://<hostname>/friends/viewpix.action?id=2222
>
>
> My client doesn't want the *.action* to appear in the urls so is there a way
> to launch the action by using friendly urls, e.g., like these:
>
>
>  - http://<hostname>/friends/viewpix
>  - http://<hostname>/friends/viewpix?id=2222.
>
>
> Thanks.
>

Attachment: user_189354.ezm (zipped)
Am Sonntag, 27. Juli 2008 21:44:04 schrieb Chris Pratt:
> You might want to look into the RESTful URL's plugin. But you can
> just override the extension. I usually set mine to .html (to hide the
> technology being used), but I believe you can set it no nothing as
> well. I use the following in struts.xml, I believe you can set the
> value to "" also.
>
>  <constant name="struts.action.extension" value="html"/>

Setting the extension to "" is a bad idea. In this case, the default action
mapper thinks every ressource (png,jpg,js,css,etc) is an action.

However, this may work with the REST plugin.

 Piero

Attachment: user_189355.ezm (zipped)
Thanks Chris and Piero. I'll give it a try.


On Sun, Jul 27, 2008 at 4:05 PM, Piero Sartini <lists@(protected):

> Am Sonntag, 27. Juli 2008 21:44:04 schrieb Chris Pratt:
> > You might want to look into the RESTful URL's plugin. But you can
> > just override the extension. I usually set mine to .html (to hide the
> > technology being used), but I believe you can set it no nothing as
> > well. I use the following in struts.xml, I believe you can set the
> > value to "" also.
> >
> >  <constant name="struts.action.extension" value="html"/>
>
> Setting the extension to "" is a bad idea. In this case, the default action
> mapper thinks every ressource (png,jpg,js,css,etc) is an action.
>
> However, this may work with the REST plugin.
>
>     Piero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189351.ezm (zipped)
Hello,

When I try to access a list that is not there at all on the valuestack, I am
left with empty page without any information. For instance,

<s:select headerKey="" headerValue="Select" theme="simple"
       name="form.cesd.year" list="form.shortyearsList" />

and form.shortyearsList donot exist at all.

Is this the default behaviour? Is there any way I would be able to get
error/debug messages? I am running struts 2.0.11 with devMode set to true
and debugging interceptor sitting on the interceptor stack.

--
Thanks
Ram

Attachment: user_189353.ezm (zipped)
I've been having trouble getting s:include and s:param to work.

I have a snippet I want to include in multiple pages. This snippet will want to
make use of Struts 2 tags and OGNL, though at present I just need a simple
c:out.

The snippet looks like:
<%@(protected)" %>
<div class="primaryBox">
<h1>Competition Information</h1>
<c:out value="${comp.name}" />
</div>
------------- END --------------

I'm currently using it with:
  <s:include value="/WEB-INF/components/competitions/identity-readonly.jsp">
  <s:param name="comp" value="competition" />
  </s:include>
------------ END -------------

The c:out isn't printing anything.

I've tried using ${} notation in the param value; that doesn't lead any
different behavoir for me.

If I reference competition.name in the snippet and skip the s:param, everything
works on this page (because the action exposes the competition property.
However other pages that include it will not expose it directly (but I can
navigate to it from properties that are exposed).

What am I missing?

Eric


Attachment: user_189356.ezm (zipped)
IIRC the <s:param.../> tag is for parameterizing components; AFAIK it doesn't add anything to a scope.

(That being said, as this question seems to come up rather frequently, maybe the include tag should add its params to the request used for the include, if that's possible?)

Dave

--- On Sun, 7/27/08, Eric D Nielsen <nielsene@(protected):
> I've been having trouble getting s:include and s:param to work.
>
> I have a snippet I want to include in multiple pages. This
> snippet will want to make use of Struts 2 tags and OGNL,
> though at present I just need a simple c:out.
>
> The snippet looks like:
> <%@(protected)"
> uri="http://java.sun.com/jsp/jstl/core" %>
> <div class="primaryBox">
>  <h1>Competition Information</h1>
>  <c:out value="${comp.name}" />
> </div>
> ------------- END --------------
>
> I'm currently using it with:
>   <s:include
> value="/WEB-INF/components/competitions/identity-readonly.jsp">
>   <s:param name="comp"
> value="competition" />
>   </s:include>
> ------------ END -------------
>
> The c:out isn't printing anything.
>
> I've tried using ${} notation in the param value; that
> doesn't lead any
> different behavoir for me.
>
> If I reference competition.name in the snippet and skip the
> s:param, everything
> works on this page (because the action exposes the
> competition property.
> However other pages that include it will not expose it
> directly (but I can
> navigate to it from properties that are exposed).
>
> What am I missing?
>
> Eric


Attachment: user_189364.ezm (zipped)
--- On Sun, 7/27/08, Dave Newton <newton.dave@(protected):
> (That being said, as this question seems to come up rather
> frequently, maybe the include tag should add its params to
> the request used for the include, if that's possible?)

It already does; not sure what I was thinking there. (I do know; I was looking at the wrong code.)

I'm able to access parameters set via a nested <s:param.../> using both <c:out value="${param.foo}"/> and ${param.foo}.

If the value is coming from the action then you shouldn't even need to set it via an <s:param.../> since the value stack is available in included pages--action properties are available via both S2 tags and EL (via the custom request hoobie-doobie).

Dave


Attachment: user_189357.ezm (zipped)

Hi,

no, no error! My first form works good with ajax and updates some table
value, but this second form that should save one value from textfield and
redirect from that page, works fine with called submit method, but there is
no redirection, it just stays on this page, it even not refresh.

--
Thx, Milan



Dhiraj Thakur wrote:
>
> r u getting any error?
>
> Regards,
> Dhiraj
>
> On Fri, Jul 25, 2008 at 9:29 PM, Milan Milanovic
> <milanmilanovich@(protected):
>
>>
>> Hi,
>>
>> I have two forms in my .jsp page which are connected to one Action class.
>> They both works fine, but when user submit second form, method in action
>> class
>> is called, but no redirection to resulting .jsp page (as defined GOOD in
>> struts.xml) is done ?
>>
>> This is my (second) form:
>>
>> <s:form action="save" validate="false">
>>     <s:textfield id="value" tabindex="1" label="Value" name="value"/>
>>     <s:submit theme="ajax" tabindex="2" cssStyle="submit"
>> cssClass="submit"
>> align="right" value="Save"/>
>> </s:form>
>>
>> and this is from struts.xml:
>>
>> <action name="save" class="myActionClass" method="save">
>>        <result>/pages/firstPage.jsp</result>
>> </action>
>>
>> --
>> Thx, Milan
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--Form-doesn%27t-redirect-tp18654630p18654630.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_189358.ezm (zipped)
--- On Sun, 7/27/08, Milan Milanovic <milanmilanovich@(protected):
>>> <s:form action="save" validate="false">
>>>  <s:textfield id="value" tabindex="1" label="Value" name="value"/>
>>>  <s:submit theme="ajax" tabindex="2" cssStyle="submit"
>>>         cssClass="submit" align="right" value="Save"/>
>>> </s:form>

Do Ajax forms redirect? I thought they submitted in the background via an XHR. Since you don't have a target specified, would the result just be ignored?

Dave


Attachment: user_189359.ezm (zipped)
Quick question for which, I can't for the life of me find an answer in
the documentation.

From within an Action that extends ActionSupport, how can I get access
to another action's URL from knowing the name of that other action.

With Struts1, I would have done something like:

  (new ActionRedirect(mapping.findForward("otherActionName"))).getPath();

What's Struts2's equivalent? Does the action need to implement some
"Aware" interface?

Attachment: user_189360.ezm (zipped)
Hi Folks,

What's the most straightforward way to secure my REST URLs?

I'd assumed that I'd be able to use the standard JEE approach and
secure based on URL patterns but this doesn't seem to work (on
Websphere anyway) and I'm assuming it's to do with the fact everything
I'm doing is happening in filters rather than working with 'real'
resources. (I don't get any errors, I just get to see resources I
shouldn't when I'm not authenticated).

Is there some sort of Security Interceptor I should enable or should
this work the way I initially assumed?

Has anybody else (Jeromy?) done this?

Cheers

Mike

Attachment: user_189361.ezm (zipped)
I should probably add that I'm just trying to authenticate via LDAP at
this stage. Authorization will be implemented later.

2008/7/28 Mike Watson <michael.f.watson@(protected)>:
> Hi Folks,
>
> What's the most straightforward way to secure my REST URLs?
>
> I'd assumed that I'd be able to use the standard JEE approach and
> secure based on URL patterns but this doesn't seem to work (on
> Websphere anyway) and I'm assuming it's to do with the fact everything
> I'm doing is happening in filters rather than working with 'real'
> resources. (I don't get any errors, I just get to see resources I
> shouldn't when I'm not authenticated).
>
> Is there some sort of Security Interceptor I should enable or should
> this work the way I initially assumed?
>
> Has anybody else (Jeromy?) done this?
>
> Cheers
>
> Mike
>

Attachment: user_189362.ezm (zipped)

we fixed the issue by writing a trainInterceptor whcih always takes a backup
of the params passed through request and if the action doesnt return errors
deletes them else stores them in session.

The next pages to which user jumps we are first checking if there are nay
backup objects in session... if yes then restoring them from there.


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


Attachment: user_189363.ezm (zipped)


--- On Fri, 7/25/08, holod <serega.sheypak@(protected):
> I've seen <s:div/> tag, but I didn't understand how can
> I invoke request to action manually (by mouse click for example)

><s:a...>?

>http://struts.apache.org/2.x/docs/dojo-anchor.html

>Note that if you're using S2.0 you'll need to look at the docs at:

>http://struts.apache.org/2.0.11/docs/dojo-anchor.html

>because of the way the wiki works.

>Dave

As I understood, I have to use dojo plugin (additional jar).
Please, tell me, is it possible to avoid usage of dojo plugin?
Seems like my problem can be solved:
if <s:div/> would not send request automatically, when page is loaded, but
only on user mouse click, I would be happy using it without additional dojo
plugin.
I've set autoStart="false" but it doesn't help :( Is there are any other
oppotunities to stop automatic first-time execution?


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


Attachment: user_189365.ezm (zipped)

Now, I have another problem:
My iterator generates <tr>some content</tr>
I want to give id="bla-bla" to my generated raws of table.

For example iterator makes 5 iterations, I get 5 rows (<tr>some
content</tr>), but I want to set id attribute for them:
<tr id="MyGeneratedRow0">some content</tr>
<tr id="MyGeneratedRow1">some content</tr>
<tr id="MyGeneratedRow2">some content</tr>
<tr id="MyGeneratedRow3">some content</tr>
<tr id="MyGeneratedRow4">some content</tr>

I use this code:
<s:iterator value="lawDraft.docs" id="doc" status="document">
  <s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
value="document.index"/>"/>
  <tr id="%{#rawMainDocIdParam}">
      some content
  </tr>
</s:iterator>

The problem is: I'm trying to access status (starts from 0) of iterator,
I've tried
<s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
value="document.index"/>"/>
I get error: "No information about attribute tag document.index"
I've tried
<s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
value="#document.index"/>"/>
and
<s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
value="%{#document.index}"/>"/>
In both cases I get error "Can't convert to xml document.index"

Any suggestions, please, can't understand mistake.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189366.ezm (zipped)
Hi,
> I use this code:
> <s:iterator value="lawDraft.docs" id="doc" status="document">
>    <s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
> value="document.index"/>"/>
>    <tr id="%{#rawMainDocIdParam}">
>       some content
>    </tr>
> </s:iterator>
>  

For this I usually do something like (untested):

<s:iterator ...>
  <s:set var="i" value="%{#status.index}"/>
  <tr id="row_${i}">...</tr>
</s:iterator>

Btw, you can't use OGNL expression in non-struts tags (you tried to use
it in tr).
There's a tabletags taglib for struts2, which might be useful for you.

Hope that helps,
Joachim
> The problem is: I'm trying to access status (starts from 0) of iterator,
> I've tried
> <s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
> value="document.index"/>"/>
> I get error: "No information about attribute tag document.index"
> I've tried
> <s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
> value="#document.index"/>"/>
> and
> <s:param name="rawMainDocIdParam" value="attachedMainDocRow<s:property
> value="%{#document.index}"/>"/>
> In both cases I get error "Can't convert to xml document.index"
>
> Any suggestions, please, can't understand mistake.
>  


Attachment: user_189367.ezm (zipped)
--- On Mon, 7/28/08, holod <serega.sheypak@(protected):
> [...] but I want to set id attribute for them:
> <tr id="MyGeneratedRow0">some content</tr>
> [...]
>
> I use this code:
> <s:iterator value="lawDraft.docs" id="doc" status="document">
>    <s:param name="rawMainDocIdParam"
> value="attachedMainDocRow<s:property
> value="document.index"/>"/>

That's not valid JSP; you can't nest tags like that.

> Any suggestions, please, can't understand mistake.

That's not what <s:param...> is for; it's for parameterizing other tags.

<tr id="foo<s:property value="#status.index">">bar</tr>

You could use <s:set...> to create the ID if you don't want to create it on-the-fly.

Dave


Attachment: user_189368.ezm (zipped)


That's not valid JSP; you can't nest tags like that.

> Any suggestions, please, can't understand mistake.

That's not what <s:param...> is for; it's for parameterizing other tags.

<tr id="foo<s:property value="#status.index">">bar</tr>

You could use <s:set...> to create the ID if you don't want to create it
on-the-fly.

<tr id="attachedMainDocRow<s:property value="#document.status"/>">
Some content
</tr>

When I inspect source of generated html page, I see:
<tr id="attachedMainDocRow">
Some content
</tr>

My rows were printed several times (that's ok), but #document.status is not
used, seems like it's "" or null, but it can't be so. My iterator iterates
several times and gets values from list.

Is there any issues with status of iterator?

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

<tr id="attachedMainDocRow<s:property value="#document.count"/>">

works fine. It just starts from 1, not from 0
Why? I can't understand what has happened to index.
count is not so bad, thanks for you help and cooperation!
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189370.ezm (zipped)

I use <s:a/> tag.
It has attribute targets=""
My targets generated inside <s:interator/> It means they have distinguish
Id's:
<tr id="attachedMainDocRow1">someContent</tr>
<tr id="attachedMainDocRow2">someContent</tr>
<tr id="attachedMainDocRow3">someContent</tr>

I make id attribute of <tr> with this expression:
<tr id="attachedMainDocRow<s:property value="#document.count"/>">
It works fine.
Each generated <tr> has it's own <s:a/>
I want each <s:a/> use it's own <tr> as targets

This is my code:
<s:a id="" showLoadingText="false"
targets="%{'attachedMainDocRow'#document.count}"
                     theme="ajax" href="%{#deleteDocumentAction}">
click on me to delete document                    
       </s:a>

But my targets attribute is empty. I'm testing this expression:
targets[<s:property value="'attachedMainDocRow'{#document.count}"/>]
I get empty string or at least "attachedMainDocRow" (when experimenting with
expression), I don't unsderstand how can i put them together.
I don't know how to compose constant string prefix "attachedMainDocRow" and
dynamic document.count into one string using expression.

Please, help.


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


Attachment: user_189371.ezm (zipped)

targets[<s:property value="%{'attachedMainDocRow' + #document.count}"/>]
works fine,
<s:a id="" showLoadingText="false" targets="%{'attachedMainDocRow' +
#document.count}"
                     theme="ajax" href="%{#deleteDocumentAction}">
                    <s:url value= "/>
                 </s:a>

rewrites content of html element with id="attachedMainDocRow{num}"
{num} is iterator count value.

So easy :)
--
Sent from the Struts - User mailing list archive at Nabble.com.

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