Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 9 Jan 2010 19:28:30 -0000 Issue 8978

user-digest-help

2010-01-09


Author LoginPost Reply

user Digest 9 Jan 2010 19:28:30 -0000 Issue 8978

Topics (messages 204571 through 204595):

validation question
 204571 by: Robby Atchison
 204583 by: Gabriel Belingueres

Re: How to nest Struts Tags
 204572 by: RogerV
 204573 by: RogerV
 204575 by: Johannes Geppert
 204577 by: RogerV
 204578 by: Johannes Geppert
 204580 by: RogerV
 204582 by: RogerV
 204584 by: Gabriel Belingueres

Re: Guice integration
 204574 by: Lukasz Lenart

Re: problems with struts2 and session
 204576 by: Pawe³ Wielgus

Problem with Struts 2 and security constraint
 204579 by: Juanjo C

Re: Additional validation for j_security_check action
 204581 by: Juanjo C

Re: struts2 and tables
 204585 by: Hans Solo
 204588 by: Sergio

Re: freemarker error in select tag
 204586 by: Johannes Geppert

Re: Struts, Tomcat, JNDI, JDBC without use of an ORM Library such as Hibernate
 204587 by: Bill Bohnenberger

Struts Classic and token not working on one server on Firefox
 204589 by: Greg Dunn

Struts 2 token and FilterDispatcher
 204590 by: eduramiba
 204591 by: eduramiba

The requested resource is not available
 204592 by: Nguyen Xuan Son
 204593 by: eduramiba
 204594 by: Nguyen Xuan Son
 204595 by: eduramiba

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_204571.ezm (zipped)
Hello, I would like to know how an actionname-validation.xml is tied to the
client-side validation. I figure somewhere the xml file is read and
Javascript is output. I'm having trouble connecting the dots. Any
information and help will be appreciated.



Best regards!



Robby

Rob_26@(protected)




Attachment: user_204583.ezm (zipped)
As a starting point you may check the freemarker .ftl files from the
XHTML template.

2010/1/8 Robby Atchison <rob_26@(protected)>:
> Hello,  I would like to know how an actionname-validation.xml is tied to the
> client-side validation.  I figure somewhere the xml file is read and
> Javascript is output.  I'm having trouble connecting the dots.  Any
> information and help will be appreciated.
>
>
>
> Best regards!
>
>
>
> Robby
>
> Rob_26@(protected)
>
>
>
>


Attachment: user_204572.ezm (zipped)



Gabriel Belingueres-2 wrote:
>
> The <s:iterator> tag (without the var attribute) push the current item
> to the top of the ValueStack.
> <s:property/> will get the value from the top of the stack.
>
> IMHO, I think this is a bad coding idiom. I don't like to think too
> much where the data came from.
>

Actually what I was asking is how to to access the value of <s:property/>
within other tags. So for example,

<sj:tabbedpanel id="mytabs2" selectedTab="1">
<s:iterator status="status" value="config.groupList">

   <s:url id="url" action="get-ccf-data" method="getParameterList">
     <s:param name="displayGroup" value="<s:property/>"/>
   </s:url>
 
   <sj:tab id="tab%{#status.index}" href="%{url}" label="<s:property/>"/>
</s:iterator>    
  </sj:tabbedpanel>

doesn't work. I don't get any paramters on the URL in the generated .html
and the tabbed headers all have the String value "&lt;s:property/&gt" rather
than the value of <s:property/>

Regards



> 2010/1/7 RogerV <roger.varley@(protected)>:
>>
>> Hi
>>
>> <s:iterator status="stat" value="config.groupList" >
>> <s:url id="url1" action="get-ccf-data" method="getParameterList">
>>        <s:param name="displayGroup" value="<what goes here?>"/>
>>      </s:url>
>>  <s:a href="%{url1}"><s:property/></s:a>
>>  </s:iterator>
>>
>> The iterator is returning a string value on each iteration - what's the
>> incantation to get the value of <s:property/> into the value parameter of
>> the param tag?
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27062761.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)
>
>
>

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



Attachment: user_204573.ezm (zipped)



RogerV wrote:
>
>
>
> Gabriel Belingueres-2 wrote:
>>
>> The <s:iterator> tag (without the var attribute) push the current item
>> to the top of the ValueStack.
>> <s:property/> will get the value from the top of the stack.
>>
>> IMHO, I think this is a bad coding idiom. I don't like to think too
>> much where the data came from.
>>
>
> Actually what I was asking is how to to access the value of <s:property/>
> within other tags. So for example,
>
> <sj:tabbedpanel id="mytabs2" selectedTab="1">
> <s:iterator status="status" value="config.groupList">
>
>     <s:url id="url" action="get-ccf-data" method="getParameterList">
>      <s:param name="displayGroup" value="<s:property/>"/>
>     </s:url>
>    
>     <sj:tab id="tab%{#status.index}" href="%{url}"
> label="<s:property/>"/>
> </s:iterator>    
>   </sj:tabbedpanel>
>
> doesn't work. I don't get any paramters on the URL in the generated .html
> and the tabbed headers all have the String value "&lt;s:property/&gt"
> rather than the value of <s:property/>
>
> Regards
>
>
>
>>
>>
>> Actually, what I see in the sj:tab label tag is the escaped < and >
>> characters ie "& lt " and "& gt " - Nabble appears to have translated
>> them back ...
>>
>> 2010/1/7 RogerV <roger.varley@(protected)>:
>>>
>>> Hi
>>>
>>> <s:iterator status="stat" value="config.groupList" >
>>> <s:url id="url1" action="get-ccf-data" method="getParameterList">
>>>        <s:param name="displayGroup" value="<what goes here?>"/>
>>>      </s:url>
>>>  <s:a href="%{url1}"><s:property/></s:a>
>>>  </s:iterator>
>>>
>>> The iterator is returning a string value on each iteration - what's the
>>> incantation to get the value of <s:property/> into the value parameter
>>> of
>>> the param tag?
>>> --
>>> View this message in context:
>>> http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27062761.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)
>>
>>
>>
>
>

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



Attachment: user_204575.ezm (zipped)

Try it with this:

   <s:url id="url" action="get-ccf-data" method="getParameterList">
   <s:param name="displayGroup"<s:property/></s:param>
   </s:url>

Best Regards

Johannes Geppert


RogerV wrote:
>
>
>
> RogerV wrote:
>>
>>
>>
>> Gabriel Belingueres-2 wrote:
>>>
>>> The <s:iterator> tag (without the var attribute) push the current item
>>> to the top of the ValueStack.
>>> <s:property/> will get the value from the top of the stack.
>>>
>>> IMHO, I think this is a bad coding idiom. I don't like to think too
>>> much where the data came from.
>>>
>>
>> Actually what I was asking is how to to access the value of <s:property/>
>> within other tags. So for example,
>>
>> <sj:tabbedpanel id="mytabs2" selectedTab="1">
>> <s:iterator status="status" value="config.groupList">
>>
>>     <s:url id="url" action="get-ccf-data" method="getParameterList">
>>      <s:param name="displayGroup" value="<s:property/>"/>
>>     </s:url>
>>    
>>     <sj:tab id="tab%{#status.index}" href="%{url}"
>> label="<s:property/>"/>
>> </s:iterator>    
>>   </sj:tabbedpanel>
>>
>> doesn't work. I don't get any paramters on the URL in the generated .html
>> and the tabbed headers all have the String value "&lt;s:property/&gt"
>> rather than the value of <s:property/>
>>
>> Regards
>>
>>
>>
>>>
>>>
>>> Actually, what I see in the sj:tab label tag is the escaped < and >
>>> characters ie "& lt " and "& gt " - Nabble appears to have translated
>>> them back ...
>>>
>>> 2010/1/7 RogerV <roger.varley@(protected)>:
>>>>
>>>> Hi
>>>>
>>>> <s:iterator status="stat" value="config.groupList" >
>>>> <s:url id="url1" action="get-ccf-data" method="getParameterList">
>>>>        <s:param name="displayGroup" value="<what goes here?>"/>
>>>>      </s:url>
>>>>  <s:a href="%{url1}"><s:property/></s:a>
>>>>  </s:iterator>
>>>>
>>>> The iterator is returning a string value on each iteration - what's the
>>>> incantation to get the value of <s:property/> into the value parameter
>>>> of
>>>> the param tag?
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27062761.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)
>>>
>>>
>>>
>>
>>
>
>


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

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



Attachment: user_204577.ezm (zipped)



Johannes Geppert wrote:
>
> Try it with this:
>
>     <s:url id="url" action="get-ccf-data" method="getParameterList">
>     <s:param name="displayGroup"<s:property/></s:param>
>     </s:url>
>
>

When I try this, it fails because the <s:param> tag is not closed properly.
In an attempt to go back to basics I've hard coded the value attribute of
the <s:param> tag and I've now got;

<s:iterator status="stat" value="config.groupList" >
<s:url id="url1" action="get-ccf-data">
     <s:param name="displayGroup" value="Test"/>
   </s:url>

${url1} <s:property/> <br />  
<s:a href="%{url1}"><s:property/></s:a><br />
<s:property value= "><s:property /> <br />
</s:iterator>

When I view the generated html I see

/genesis/get-ccf-data Group 1 <br />  
/genesis/get-ccf-data Group 1 <br />
/genesis/get-ccf-data Group 1 <br />

The <s:param> tag seems to be being ignored. I've tried with
includeParams="none", "all" and "get" with the same results. Is there some
global property I've got to set to get the URL tag to recognise the param
tag. This is with Struts 2.1.8

Regards

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



Attachment: user_204578.ezm (zipped)

Sorry I forgot to close the Tag

      <s:url id="url" action="get-ccf-data" method="getParameterList">
      <s:param name="displayGroup"><s:property/></s:param>
      </s:url>


RogerV wrote:
>
>
> When I try this, it fails because the <s:param> tag is not closed
> properly. In an attempt to go back to basics I've hard coded the value
> attribute of the <s:param> tag and I've now got;
>


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

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



Attachment: user_204580.ezm (zipped)

Damn - how do I get Nabble to stop interrpretting my code examples as HTML?
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204582.ezm (zipped)



Johannes Geppert wrote:
>
> Sorry I forgot to close the Tag
>
>       <s:url id="url" action="get-ccf-data" method="getParameterList">
>       <s:param name="displayGroup"><s:property/></s:param>
>       </s:url>
>

Thank you Johannes, that works and when I use %{url} I've now got the
parameters as well! So why doesn't using <s:param name="parameterName"
value="parameterValue"> work with the url tag, even when the value is
hardcoded as a constant?

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



Attachment: user_204584.ezm (zipped)
name the current iterated object, something like that:

<s:iterator var="elem" status="status" value="config.groupList">

  <s:url id="url" action="get-ccf-data" method="getParameterList">
    <s:param name="displayGroup" value="%{#elem}"/>
  </s:url>

  <sj:tab id="tab%{#status.index}" href="%{url}" label="%{#elem}"/>
</s:iterator>


2010/1/8 RogerV <roger.varley@(protected)>:
>
>
>
> Gabriel Belingueres-2 wrote:
>>
>> The <s:iterator> tag (without the var attribute) push the current item
>> to the top of the ValueStack.
>> <s:property/> will get the value from the top of the stack.
>>
>> IMHO, I think this is a bad coding idiom. I don't like to think too
>> much where the data came from.
>>
>
> Actually what I was asking is how to to access the value of <s:property/>
> within other tags. So for example,
>
>  <sj:tabbedpanel id="mytabs2" selectedTab="1">
> <s:iterator status="status" value="config.groupList">
>
>      <s:url id="url" action="get-ccf-data" method="getParameterList">
>        <s:param name="displayGroup" value="<s:property/>"/>
>      </s:url>
>
>      <sj:tab id="tab%{#status.index}" href="%{url}" label="<s:property/>"/>
> </s:iterator>
>    </sj:tabbedpanel>
>
> doesn't work. I don't get any paramters on the URL in the generated .html
> and the tabbed headers all have the String value "&lt;s:property/&gt" rather
> than the value of <s:property/>
>
> Regards
>
>
>
>> 2010/1/7 RogerV <roger.varley@(protected)>:
>>>
>>> Hi
>>>
>>> <s:iterator status="stat" value="config.groupList" >
>>> <s:url id="url1" action="get-ccf-data" method="getParameterList">
>>>        <s:param name="displayGroup" value="<what goes here?>"/>
>>>      </s:url>
>>>  <s:a href="%{url1}"><s:property/></s:a>
>>>  </s:iterator>
>>>
>>> The iterator is returning a string value on each iteration - what's the
>>> incantation to get the value of <s:property/> into the value parameter of
>>> the param tag?
>>> --
>>> View this message in context:
>>> http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27062761.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)
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27072030.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_204574.ezm (zipped)
2010/1/8 Saeed Iqbal <saeedcs@(protected)>:
> Can anyone tell me how to best integrate guice with struts please.

Try Guice plugin
http://cwiki.apache.org/S2PLUGINS/guice-plugin.html


Regards
--
Lukasz
Kapituła Javarsovia 2010
http://javarsovia.pl


Attachment: user_204576.ezm (zipped)
Hi Sergio,
this time late answear,
when You have session field in action and also setter and getter for it
then You can access session map as any other field from action in jsp,
so < s:property value="session.get('variable')" > should work,
because it is accessing normal getter in stack.
Maybe try < s:property value="getSession().get('variable')" > to be
more accurate.

Best greetings,
Paweł Wielgus.



2010/1/6 Sergio <killing-is-my-business@(protected)>:
> Paweł Wielgus escribió:
>>
>> Hi,
>> sorry for too fast response,
>> i see that it is implementing it,
>> another thing to notice is that
>> in action You have access to session field which is a map constructed
>> by struts, not real session object - as far as i remember.
>> In jsp you can do < s:property value="session.get('variable')" > to
>> show key from session in jsp.
>>
>> Hope that it will help,
>> Pawel Wielgus.
>>
>> 2010/1/6, Sergio <killing-is-my-business@(protected)>:
>>
>>>
>>> Paweł Wielgus escribió:
>>>
>>>>
>>>> Hi Sergio,
>>>> add SessionAware interface to your action.
>>>>
>>>> Best greetings,
>>>> Pawel Wielgus.
>>>>
>>>> 2010/1/5, Sergio <killing-is-my-business@(protected)>:
>>>>
>>>>
>>>>>
>>>>> Sergio escribió:
>>>>>
>>>>>
>>>>>>
>>>>>> Hi people,
>>>>>>
>>>>>> i'm a newbie to struts2. I'm having too many problems modifing session
>>>>>> parameters. I use <%= session.getAttribute( "variable" ) %> to gain
>>>>>> access to "variable" and that works when i modify "variable" into a
>>>>>> jsp page, but not inside a struts action.
>>>>>>
>>>>>> struts.xml:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>>>> <!DOCTYPE struts PUBLIC
>>>>>>  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>>>>>  "http://struts.apache.org/dtds/struts-2.0.dtd">
>>>>>>
>>>>>> <struts>
>>>>>>
>>>>>>  <constant name="struts.enable.DynamicMethodInvocation" value="false"
>>>>>> />
>>>>>>  <constant name="struts.devMode" value="true" />
>>>>>>
>>>>>> <package name="tads" namespace="/" extends="struts-default">
>>>>>>
>>>>>> <action name="HolaMundo" class="tads.HolaMundo">
>>>>>> <result>/holaMundo.jsp</result>
>>>>>> </action>
>>>>>>
>>>>>> <action name="Catalogo" class="tads.Catalogo">
>>>>>>    <result  name="error">/ErrorCatalogo.jsp</result>
>>>>>>    <result>/Catalogo.jsp</result>
>>>>>>  </action>
>>>>>>
>>>>>> <action name="Actualiza" class="tads.Actualiza">
>>>>>>    <result>/Actualiza.jsp</result>
>>>>>>  </action>
>>>>>>
>>>>>>
>>>>>>
>>>>>> </package>
>>>>>>
>>>>>> </struts>
>>>>>>
>>>>>> extract from a jsp page, result from an ajax action working:
>>>>>>
>>>>>> <s:form id="form" >
>>>>>>                <s:textfield name="politico" label="politico"/><br>
>>>>>>                <s:hidden name="prueba" value="escondido" />
>>>>>>              </s:form>
>>>>>>              <s:url id="actualiza" value="/Actualiza.action" />
>>>>>>
>>>>>> <sx:submit type="button" label="dale" href="%{actualiza}"
>>>>>> formId="form" align="center" targets="secondaryContent"/>
>>>>>>
>>>>>> i see "politico" and "prueba" into Actualiza.action so the action
>>>>>> Actualiza works.
>>>>>>
>>>>>> Actualiza.java:
>>>>>>
>>>>>> package tads;
>>>>>> import java.util.*;
>>>>>>
>>>>>> import javax.servlet.http.HttpSession;
>>>>>> import com.opensymphony.xwork2.ActionSupport;
>>>>>> import org.apache.struts2.interceptor.SessionAware;
>>>>>> import com.opensymphony.xwork2.ActionContext;
>>>>>>
>>>>>>
>>>>>> @SuppressWarnings("serial")
>>>>>> public class Actualiza extends ActionSupport implements SessionAware {
>>>>>>  private String politico;
>>>>>>  private String prueba;
>>>>>>  private Map session;
>>>>>>    public String execute() throws Exception {
>>>>>>
>>>>>>      this.getSession().put("variable","pruebamil");
>>>>>>      return SUCCESS;
>>>>>>      }
>>>>>>  public String getPolitico() {
>>>>>>      return politico;
>>>>>>  }
>>>>>>
>>>>>>  public void setPolitico(String politico) {
>>>>>>      this.politico = politico;
>>>>>>  }
>>>>>>
>>>>>>  public String getPrueba() {
>>>>>>      return prueba;
>>>>>>  }
>>>>>>
>>>>>>  public void setPrueba(String prueba) {
>>>>>>      this.prueba = prueba;
>>>>>>  }
>>>>>>  public void setSession(Map session) {
>>>>>>      this.session = session;
>>>>>>    }
>>>>>>        public Map getSession() {
>>>>>>      return session;
>>>>>>    }
>>>>>> }
>>>>>>
>>>>>> in that situation. Actualiza.jsp doesn't show "variable" atribute from
>>>>>> session, using "<%= session.getAttribute( "variable" ) %>". It shows
>>>>>> null.
>>>>>>
>>>>>> can anybody help me? I'm doing exactly what struts2 FAQ say (How do we
>>>>>> get access to the session).
>>>>>>
>>>>>> thanks in advance.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> i've tried with
>>>>>
>>>>>      <%= session.getAttribute( "variable" ) %>
>>>>>
>>>>> and
>>>>>
>>>>>      <s:property value="#session.variable"></s:property>
>>>>>
>>>>> and surprise, both works. After closing and opening eclipse 3.4.0
>>>>> works.
>>>>> I think this is a bad memory managing of eclipse. Does anybody knows
>>>>> something about this?
>>>>>
>>>>> --
>>>>> Sergio
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> public class Actualiza extends ActionSupport implements SessionAware
>>>
>>> is that?
>>>
>>> thanks for replying
>>>
>>>
>>> --
>>> Sergio
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>>
>>
>>
>>
>
> as far as i remember :) "< s:property value="session.get('variable')" >"
> didn't work because the "get" method. Both "<%= session.getAttribute(
> "variable" ) %>" and "<s:property value="#session.variable"></s:property>"
> worked, but i had to close and open eclipse. Bad memory management of
> eclipse i think.
>
> thanks for your fast reply :)
>
> --
> Sergio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204579.ezm (zipped)
Hi,

I'm trying to use JAAS with Struts2. I have my own implementation of JAAS
and if I use it in an application without Struts, it works fine. I'm using
FORM like authentication method.

But when I wan to use it with Struts 2, I get an 404 error (I have an
constraint with "/*"). If I deactivate the security constraint (I comment
the element security-constraint in the web.xml file), the application works
fine again.

I have tried to use the BASIC authentication method with the realm that
comes with Tomcat with the application struts-blank. The results is the
same. When I active the security-constraint, I get an 404 error, but when I
deactivate security, works fine.

Is like if the filter of struts don't works... any of this has sense...

any idea?

Attachment: user_204581.ezm (zipped)
Sorry for use this thread, but I'm desperate....

Dani, How to use Struts 2 with JAAS? I have my own implementation of JAAS
that works fine in applications without Struts, but don't works if I use it
into Strust.....

Can you help me?

2009/6/17 Wes Wannemacher <wesw@(protected)>

> I have thought about this a bit lately and I never came up with a good
> solution. In this case, you are sort of hacking the framework by using
> our view library to render the UI, but the processing happens
> elsewhere. That's why I don't know if there is a good solution to
> sprinkle in some validation as well, since validation is handled as a
> function of the processing.
>
> I have thought about trying to put an action out in front of
> j_security_check. I am not sure if it would work, but you can try to
> create a thin action that has the getters/setters for j_username /
> j_password, then dispatch to j_security_check. I don't know if you're
> feeling up to it, but if you hack around enough and find a way to
> pre-process the form with struts then hand it off to j_security_check,
> I'd be interested in how you did it.
>
> -Wes
>
> On Wed, Jun 17, 2009 at 11:06 AM, Daniil Petrov<petrovdv@(protected):
> > Hi,
> >
> > I am using JAAS authentication in a Struts 2 web application. A login
> form
> > looks like:
> >
> >   <s:form method="post" action="j_security_check">
> >     <s:textfield label="User" name="j_username"/>
> >     <s:password label="Password" name="j_password"/>
> >     <s:submit value="Log In"/>
> >   </s:form>
> >
> > I need to validate password field before passing it to the authentication
> > service. Basically, I need to check that this field is not empty. Struts
> 2
> > suggests two ways for validation: either implement validate() method in
> > action or configure field validators in xml file. But in this case I do
> not
> > have a particular action, because j_security_check is something
> > container-dependent. What validation can be done in this case?
> >
> > Thanks,
> > Daniil
> >
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_204585.ezm (zipped)
<s:param name="politico"><s:property /></s:param>

should work.


2010/1/8 Chris Pratt <thechrispratt@(protected)>:
> I'm not positive but you might try:
>
> <s:param name="politico" value="${this}"/>
>
>  (*Chris*)
>
> On Thu, Jan 7, 2010 at 4:09 PM, Sergio
> <killing-is-my-business@(protected):
>
>> Sergio escribió:
>>
>>  Chris Pratt escribió:
>>>
>>>> You can refer to the DisplayTag documentation about what collections they
>>>> support, there are quite a few.  I usually use a java.util.List of
>>>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
>>>> get that data from the database into a structure that can be displayed.
>>>>
>>>> As for your other question, take a look at the last column in my example,
>>>> that's exactly what it does.
>>>>  (*Chris*)
>>>>
>>>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>>>> <killing-is-my-business@(protected):
>>>>
>>>>
>>>>
>>>>> but i don't understand the data structure to hold the users. When you
>>>>> get
>>>>> the ResultSet from mysql, how do you put it into the list? Without using
>>>>> hibernate or similar, i've tried with several collections, for example a
>>>>> <String >, Map <String><String>. The first string holds the name or user
>>>>> id,
>>>>> and the map holds attribute-value pair. No success, i think that is a
>>>>> bad
>>>>> solution.
>>>>>
>>>>> and another question: i need the user id be passed to another action as
>>>>> a
>>>>> parameter. I've tried with a s:form and a hidden field, something like
>>>>> <input type="hidden" value="<s:property>"> is the idea. It's about an
>>>>> online
>>>>> shop, and i'm having problems with:
>>>>>
>>>>> 1.- listing products from mysql
>>>>> 2.- adding products to the cart (from a mysql products list
>>>>>
>>>>> i'm a little newbie with struts.....
>>>>>
>>>>> regards
>>>>>
>>>>> --
>>>>> Sergio
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> wow, i think i got. I'll take a look.
>>>
>>> thank you very much
>>>
>>>  my point is that i have a property which is a String, and i need that
>> string in two ways: as a literal string and as a parameter to another
>> action. Using "s:property", something like this:
>>
>>    <table>
>>    <s:iterator value="#session.carrito">
>>        <tr>
>>            <td><s:property />
>>            </td>
>>            <td><s:url id="idResta" value="/Del.action">
>>                    <s:param name="politico" value="[0]"></s:param>
>>                </s:url>
>>                <sx:a accesskey="6" href="%{idResta}"
>> targets="secondaryContent" >Fuera</sx:a>
>>            </td>
>>        </tr>
>>    </s:iterator>
>>    </table>
>>
>> sessio.carrito is a String ArrayList and iterator works. Each of that
>> string must be passed to another action, say Action2, like a form with a
>> hidden field. During Action2 (which delete "politico" from session.carrito)
>> there's a *java.lang.ArrayIndexOutOfBoundsException: -1*
>>
>> I thought that "[0]" helds the actual value, same as "<s:property />". Into
>> "param" tag i've tried also with value="{ #this }" but i got that java
>> exception.
>>
>> Something like:
>>
>> <s:param name="politico" value="<s:property />"></s:param>
>>
>> is my literal desire :)
>>
>> My struts action has private String politico and getters y setters. I'm not
>> really sure if  "politco" is viewed by Action2.
>>
>>
>> regards
>> **
>>
>> --
>> Sergio
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>


Attachment: user_204588.ezm (zipped)
Hans Solo escribió:
> <s:param name="politico"><s:property /></s:param>
>
> should work.
>
>
> 2010/1/8 Chris Pratt <thechrispratt@(protected)>:
>  
>> I'm not positive but you might try:
>>
>> <s:param name="politico" value="${this}"/>
>>
>> (*Chris*)
>>
>> On Thu, Jan 7, 2010 at 4:09 PM, Sergio
>> <killing-is-my-business@(protected):
>>
>>  
>>> Sergio escribió:
>>>
>>> Chris Pratt escribió:
>>>    
>>>>> You can refer to the DisplayTag documentation about what collections they
>>>>> support, there are quite a few. I usually use a java.util.List of
>>>>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
>>>>> get that data from the database into a structure that can be displayed.
>>>>>
>>>>> As for your other question, take a look at the last column in my example,
>>>>> that's exactly what it does.
>>>>> (*Chris*)
>>>>>
>>>>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>>>>> <killing-is-my-business@(protected):
>>>>>
>>>>>
>>>>>
>>>>>      
>>>>>> but i don't understand the data structure to hold the users. When you
>>>>>> get
>>>>>> the ResultSet from mysql, how do you put it into the list? Without using
>>>>>> hibernate or similar, i've tried with several collections, for example a
>>>>>> <String >, Map <String><String>. The first string holds the name or user
>>>>>> id,
>>>>>> and the map holds attribute-value pair. No success, i think that is a
>>>>>> bad
>>>>>> solution.
>>>>>>
>>>>>> and another question: i need the user id be passed to another action as
>>>>>> a
>>>>>> parameter. I've tried with a s:form and a hidden field, something like
>>>>>> <input type="hidden" value="<s:property>"> is the idea. It's about an
>>>>>> online
>>>>>> shop, and i'm having problems with:
>>>>>>
>>>>>> 1.- listing products from mysql
>>>>>> 2.- adding products to the cart (from a mysql products list
>>>>>>
>>>>>> i'm a little newbie with struts.....
>>>>>>
>>>>>> regards
>>>>>>
>>>>>> --
>>>>>> Sergio
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>        
>>>>>
>>>>>      
>>>> wow, i think i got. I'll take a look.
>>>>
>>>> thank you very much
>>>>
>>>> my point is that i have a property which is a String, and i need that
>>>>      
>>> string in two ways: as a literal string and as a parameter to another
>>> action. Using "s:property", something like this:
>>>
>>>   <table>
>>>   <s:iterator value="#session.carrito">
>>>     <tr>
>>>        <td><s:property />
>>>        </td>
>>>        <td><s:url id="idResta" value="/Del.action">
>>>             <s:param name="politico" value="[0]"></s:param>
>>>           </s:url>
>>>           <sx:a accesskey="6" href="%{idResta}"
>>> targets="secondaryContent" >Fuera</sx:a>
>>>        </td>
>>>     </tr>
>>>   </s:iterator>
>>>   </table>
>>>
>>> sessio.carrito is a String ArrayList and iterator works. Each of that
>>> string must be passed to another action, say Action2, like a form with a
>>> hidden field. During Action2 (which delete "politico" from session.carrito)
>>> there's a *java.lang.ArrayIndexOutOfBoundsException: -1*
>>>
>>> I thought that "[0]" helds the actual value, same as "<s:property />". Into
>>> "param" tag i've tried also with value="{ #this }" but i got that java
>>> exception.
>>>
>>> Something like:
>>>
>>> <s:param name="politico" value="<s:property />"></s:param>
>>>
>>> is my literal desire :)
>>>
>>> My struts action has private String politico and getters y setters. I'm not
>>> really sure if "politco" is viewed by Action2.
>>>
>>>
>>> regards
>>> **
>>>
>>> --
>>> Sergio
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>
>
>
>  
ok, thanks to all. Finally i get it :)

it was too easy, using java maps. To print a map from an action:

  <table>
  <s:iterator value="#session.carrito">
     <tr>
        <td><s:property value = "key"/>
        </td>
        <td><strong><s:property value = "value"/></strong> Uds.
        </td>
        <td><s:url id="idResta" value="/Del.action">
             <s:param name="politico" value = "key"></s:param>
          </s:url>
          <sx:a loadingText="Cargando" indicator="indicador"
accesskey="6" href="%{idResta}" targets="secondaryContent" >Fuera</sx:a>
        </td>
     </tr>
  </s:iterator>
  </table>


I was using ajax and i'd like to say thanks to struts2 developers, i
think it's a great job. It's too easy to perform an ajax application
with struts2. With a little number of tags you can achieve a very
functional application. Thanks, too great job.

--
Sergio



Attachment: user_204586.ezm (zipped)

problem is solved, it was a null value in the list.



Johannes Geppert wrote:
>
> I use struts2 version 2.1.8.1
>
> and this select tag:
>    <s:select name="format" list="formate" headerKey="" headerValue=""
> label="Formate" cssStyle="width: 150px; float: left"></s:select>
>
> The SelectBox is already filled so I thin the Action is not the Problem.
>
>
> Gabriel Belingueres-2 wrote:
>>
>> Please post the S2 version number, the <s:select> tag you are using
>> together with the action code to initialize the select list/map.
>>
>
>


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

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



Attachment: user_204587.ezm (zipped)
Jazz, here's a lightweight package that so far has met all of my needs:
http://butterfly.jenkov.com/ ...

Cheers, Bill*
*
On Thu, Jan 7, 2010 at 4:30 PM, Jasvinder S. Bahra <
bbdl21548@(protected):

> I'll echo the Spring suggestion. It simplifies Action-level programming by
>> quite a bit.
>>
>> On the flip side, it requires some extra XML configuration, but IMO it's a
>> good tradeoff.
>>
>
> Spring seems to be quite popular here. I'm somewhat reluctant because
> Spring provides a lot more than just Database Injection - and for the time
> being, DI is all I really want.
>
> If I cant find what I want, I guess i'll have to bite the bullet and jump
> into it.
>
> Thanks for the response.
>
>
> Jazz
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_204589.ezm (zipped)
We're using the Token system in our application, which is installed at
several hundred sites, each with their own JBoss and Apache servers
which we administer. It works perfectly at every site but one, where a
token mismatch comes up every time if the user is on Firefox. There is
no problem using IE.

Has anyone seen this and can you point us in the direction of solving
the problem?

The code is basic, in the first action class we have:

saveToken(request);

which forwards to a JSP, and in the second we have:

if (!isTokenValid(request) ) {
  return (mapping.findForward("tokenFail"));
}
resetToken(request);


Thank you,

Greg


Attachment: user_204590.ezm (zipped)

Hi, I have a problem I don't know how to approach.

For some actions, I use a token and it works perfect.

But now I would like to use http://tuckey.org/urlrewrite/ Url Rewrite
Filter which needs to include

FORWARD

in the struts 2 FilterDispatcher to work. When I do this, the JSPs with
stop working because of a NullPointerException in TokenHelper.setToken()

If I don't include FORWARD , the Url Rewrite rules only work if I set them
to redirect, not forward (default). Of course this redirects to dirty url in
the browser so it is not enough.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment: user_204591.ezm (zipped)

Hi, I have a problem I don't know how to approach.

For some actions, I use a token and it works perfect.

But now I would like to use http://tuckey.org/urlrewrite/ Url Rewrite
Filter which needs to include

<dispatcher>FORWARD</dispatcher>

in the struts 2 FilterDispatcher to work. When I do this, the JSPs with
<s:token /> stop working because of a NullPointerException in
TokenHelper.setToken()

If I don't include <dispatcher>FORWARD</dispatcher> , the Url Rewrite rules
only work if I set them to redirect, not forward (default). Of course this
redirects to dirty url in the browser so it is not enough.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204592.ezm (zipped)
dear all
in struts.xml I have

<action name="loginRegisteredAccount"
class="com.baibai.action.RegisteredAccountAction"
method="loginRegisteredAccount">
<result name="success">/g/homeNews.action</result>
<result name="input">/g/G0023_Login.jsp</result>
</action>
but when success the error appears The requested resource
(/baibai/g/homeNews.action) is not available
however when I input /baibai/g/homeNews.action by myself from the address
bar it works
and also

<action name="listNewsBySubCategory"
class="com.baibai.action.G0042_ListNewsByCategoryAction"
method="displayListNewsByCategory">
<result name="success">/g/G0042_ListNewsByCategory.jsp</result>
<result name="error" type="redirect">/g/homeNews.action</result>
</action>
it works fine

do you have any suggestion?
thank you very much

--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email   : nr0003xx@(protected)
Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
=======================================================================

Attachment: user_204593.ezm (zipped)

Hi, Nguyen Xuan Son-3.

When you want to redirect to other action you should write something like
this
<result type="redirectAction" >%{redirect}</result>

I use it for redirection to login needed actions after login and it works.


Nguyen Xuan Son-3 wrote:
>
> dear all
> in struts.xml I have
>
> <action name="loginRegisteredAccount"
> class="com.baibai.action.RegisteredAccountAction"
> method="loginRegisteredAccount">
> <result name="success">/g/homeNews.action</result>
> <result name="input">/g/G0023_Login.jsp</result>
> </action>
> but when success the error appears The requested resource
> (/baibai/g/homeNews.action) is not available
> however when I input /baibai/g/homeNews.action by myself from the address
> bar it works
> and also
>
> <action name="listNewsBySubCategory"
> class="com.baibai.action.G0042_ListNewsByCategoryAction"
> method="displayListNewsByCategory">
> <result name="success">/g/G0042_ListNewsByCategory.jsp</result>
> <result name="error" type="redirect">/g/homeNews.action</result>
> </action>
> it works fine
>
> do you have any suggestion?
> thank you very much
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email   : nr0003xx@(protected)
> Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
> =======================================================================
>
>

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



Attachment: user_204594.ezm (zipped)
dear eduramiba
I've tried

<action name="loginRegisteredAccount"
class="com.baibai.action.RegisteredAccountAction"
method="loginRegisteredAccount">
<result name="success" type="redirectAction" >%{homeNews.action}</result>
<result name="input">/g/G0023_Login.jsp</result>
</action>
but got this error
There is no Action mapped for namespace / and action name .
*The requested resource (There is no Action mapped for namespace / and
action name .) is not available.*

do you have any suggestion?

2010/1/10 <eduramiba@(protected)>

> Hi, Nguyen Xuan Son-3.
>
> When you want to redirect to other action you should write something like
> this
> <result type="redirectAction" >%{redirect}</result>
>
> I use it for redirection to login needed actions after login and it works.
>
>
> Nguyen Xuan Son-3 wrote:
> >
> > dear all
> > in struts.xml I have
> >
> > <action name="loginRegisteredAccount"
> > class="com.baibai.action.RegisteredAccountAction"
> > method="loginRegisteredAccount">
> > <result name="success">/g/homeNews.action</result>
> > <result name="input">/g/G0023_Login.jsp</result>
> > </action>
> > but when success the error appears The requested resource
> > (/baibai/g/homeNews.action) is not available
> > however when I input /baibai/g/homeNews.action by myself from the address
> > bar it works
> > and also
> >
> > <action name="listNewsBySubCategory"
> > class="com.baibai.action.G0042_ListNewsByCategoryAction"
> > method="displayListNewsByCategory">
> > <result name="success">/g/G0042_ListNewsByCategory.jsp</result>
> > <result name="error" type="redirect">/g/homeNews.action</result>
> > </action>
> > it works fine
> >
> > do you have any suggestion?
> > thank you very much
> >
> > --
> > =======================================================================
> > Ritsumeikan University, Asia JinZai Project
> > Master of Information Science
> > Nguyen Xuan Son
> >
> > Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > ShiteiHaimu
> > Rien, Room 103
> > Tel/Fax : 81-(0)90-3976 2246
> > Email   : nr0003xx@(protected)
> > Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
> > =======================================================================
> >
> >
> Quoted from:
>
> http://old.nabble.com/The-requested-resource-is-not-available-tp27090644p27090644.html
>
>


--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email   : nr0003xx@(protected)
Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
=======================================================================

Attachment: user_204595.ezm (zipped)

You only need
<result name="success" type="redirectAction" >/g/homeNews.action</result>

I use OGNL expression for dynamic redirection.


Nguyen Xuan Son-3 wrote:
>
> dear eduramiba
> I've tried
>
> <action name="loginRegisteredAccount"
> class="com.baibai.action.RegisteredAccountAction"
> method="loginRegisteredAccount">
> <result name="success" type="redirectAction" >%{homeNews.action}</result>
> <result name="input">/g/G0023_Login.jsp</result>
> </action>
> but got this error
> There is no Action mapped for namespace / and action name .
> *The requested resource (There is no Action mapped for namespace / and
> action name .) is not available.*
>
> do you have any suggestion?
>
> 2010/1/10 <eduramiba@(protected)>
>
>> Hi, Nguyen Xuan Son-3.
>>
>> When you want to redirect to other action you should write something like
>> this
>> <result type="redirectAction" >%{redirect}</result>
>>
>> I use it for redirection to login needed actions after login and it
>> works.
>>
>>
>> Nguyen Xuan Son-3 wrote:
>> >
>> > dear all
>> > in struts.xml I have
>> >
>> > <action name="loginRegisteredAccount"
>> > class="com.baibai.action.RegisteredAccountAction"
>> > method="loginRegisteredAccount">
>> > <result name="success">/g/homeNews.action</result>
>> > <result name="input">/g/G0023_Login.jsp</result>
>> > </action>
>> > but when success the error appears The requested resource
>> > (/baibai/g/homeNews.action) is not available
>> > however when I input /baibai/g/homeNews.action by myself from the
>> address
>> > bar it works
>> > and also
>> >
>> > <action name="listNewsBySubCategory"
>> > class="com.baibai.action.G0042_ListNewsByCategoryAction"
>> > method="displayListNewsByCategory">
>> > <result name="success">/g/G0042_ListNewsByCategory.jsp</result>
>> > <result name="error" type="redirect">/g/homeNews.action</result>
>> > </action>
>> > it works fine
>> >
>> > do you have any suggestion?
>> > thank you very much
>> >
>> > --
>> > =======================================================================
>> > Ritsumeikan University, Asia JinZai Project
>> > Master of Information Science
>> > Nguyen Xuan Son
>> >
>> > Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
>> > ShiteiHaimu
>> > Rien, Room 103
>> > Tel/Fax : 81-(0)90-3976 2246
>> > Email   : nr0003xx@(protected)
>> > Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
>> > =======================================================================
>> >
>> >
>> Quoted from:
>>
>> http://old.nabble.com/The-requested-resource-is-not-available-tp27090644p27090644.html
>>
>>
>
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email   : nr0003xx@(protected)
> Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
> =======================================================================
>
>

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


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