Struts Classic and token not working on one server on Firefox

2010-01-08 Thread Greg Dunn
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

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: struts2 and tables

2010-01-08 Thread Sergio

Hans Solo escribió:



should work.


2010/1/8 Chris Pratt :
  

I'm not positive but you might try:



 (*Chris*)

On Thu, Jan 7, 2010 at 4:09 PM, Sergio
wrote:



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
wrote:



  

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
, Map . 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
 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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org







  

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:

   
   
   
   
   
   
   
   
   Fuera
   
   
   
   

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 "". Into
"param" tag i've tried also with value="{ #this }" but i got that java
exception.

Something like:



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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


  


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



  

ok, thanks to all. Finally i get it :)

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






 Uds.




accesskey="6" href="%{idResta}" targets="secondaryContent" >Fuera







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


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



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

2010-01-08 Thread Bill Bohnenberger
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 <
bbdl21...@blueyonder.co.uk> wrote:

> 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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: freemarker error in select tag

2010-01-08 Thread Johannes Geppert

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:
>   label="Formate" cssStyle="width: 150px; float: left">
> 
> 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  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

-- 
View this message in context: 
http://old.nabble.com/freemarker-error-in-select-tag-tp27057643p27077523.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: struts2 and tables

2010-01-08 Thread Hans Solo


should work.


2010/1/8 Chris Pratt :
> I'm not positive but you might try:
>
> 
>
>  (*Chris*)
>
> On Thu, Jan 7, 2010 at 4:09 PM, Sergio
> wrote:
>
>> 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
 wrote:



> 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
> , Map . 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
>  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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>



>>> 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:
>>
>>    
>>    
>>        
>>            
>>            
>>            
>>                    
>>                
>>                > targets="secondaryContent" >Fuera
>>            
>>        
>>    
>>    
>>
>> 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 "". Into
>> "param" tag i've tried also with value="{ #this }" but i got that java
>> exception.
>>
>> Something like:
>>
>> 
>>
>> 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-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to nest Struts Tags

2010-01-08 Thread Gabriel Belingueres
name the current iterated object, something like that:



 
   
 

 



2010/1/8 RogerV :
>
>
>
> Gabriel Belingueres-2 wrote:
>>
>> The  tag (without the var attribute) push the current item
>> to the top of the ValueStack.
>>  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 
> within other tags. So for example,
>
>  
> 
>
>      
>        
>      
>
>      
> 
>    
>
> 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 "" rather
> than the value of 
>
> Regards
>
>
>
>> 2010/1/7 RogerV :
>>>
>>> Hi
>>>
>>> 
>>> 
>>>        
>>>      
>>>  
>>>  
>>>
>>> The iterator is returning a string value on each iteration - what's the
>>> incantation to get the value of  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-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> 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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: validation question

2010-01-08 Thread Gabriel Belingueres
As a starting point you may check the freemarker .ftl files from the
XHTML template.

2010/1/8 Robby Atchison :
> 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...@msn.com
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to nest Struts Tags

2010-01-08 Thread RogerV



Johannes Geppert wrote:
> 
> Sorry I forgot to close the Tag
> 
>   
>   
>   
> 

Thank you Johannes, that works and when I use %{url} I've now got the
parameters as well! So why doesn't using  work with the url tag, even when the value is
hardcoded as a constant?

Regards
-- 
View this message in context: 
http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27073798.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Additional validation for j_security_check action

2010-01-08 Thread Juanjo C
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 

> 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 wrote:
> > Hi,
> >
> > I am using JAAS authentication in a Struts 2 web application. A login
> form
> > looks like:
> >
> >
> >
> >
> >
> >
> >
> > 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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: How to nest Struts Tags

2010-01-08 Thread RogerV

Damn - how do I get Nabble to stop interrpretting my code examples as HTML? 
-- 
View this message in context: 
http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27073760.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with Struts 2 and security constraint

2010-01-08 Thread Juanjo C
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?


Re: How to nest Struts Tags

2010-01-08 Thread Johannes Geppert

Sorry I forgot to close the Tag

  
  
  


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


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

-- 
View this message in context: 
http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27073543.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to nest Struts Tags

2010-01-08 Thread RogerV



Johannes Geppert wrote:
> 
> Try it with this:
> 
>   
>   
>   
> 
> 

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




  
 
  ${url1}   
 
  http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27073372.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: problems with struts2 and session

2010-01-08 Thread Paweł Wielgus
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 :
> 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 :
>>
>>>
>>> Paweł Wielgus escribió:
>>>

 Hi Sergio,
 add SessionAware interface to your action.

 Best greetings,
 Pawel Wielgus.

 2010/1/5, Sergio :


>
> 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:
>>
>> 
>> >  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>  "http://struts.apache.org/dtds/struts-2.0.dtd";>
>>
>> 
>>
>>  > />
>>  
>>
>> 
>>
>> 
>> /holaMundo.jsp
>> 
>>
>> 
>>    /ErrorCatalogo.jsp
>>    /Catalogo.jsp
>>  
>>
>> 
>>    /Actualiza.jsp
>>  
>>
>>
>>
>> 
>>
>> 
>>
>> extract from a jsp page, result from an ajax action working:
>>
>> 
>>                
>>                
>>              
>>              
>>
>> > 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
>
>      
>
> 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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org





>>>
>>> public class Actualiza extends ActionSupport implements SessionAware
>>>
>>> is that?
>>>
>>> thanks for replying
>>>
>>>
>>> --
>>> Sergio
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>

Re: How to nest Struts Tags

2010-01-08 Thread Johannes Geppert

Try it with this:

  
  
  

Best Regards

Johannes Geppert


RogerV wrote:
> 
> 
> 
> RogerV wrote:
>> 
>> 
>> 
>> Gabriel Belingueres-2 wrote:
>>> 
>>> The  tag (without the var attribute) push the current item
>>> to the top of the ValueStack.
>>>  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 
>> within other tags. So for example,
>> 
>>  
>> 
>> 
>>   
>>  
>>   
>>  
>>   > label=""/>
>>   
>> 
>> 
>> 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 ""
>> rather than the value of 
>> 
>> 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 :

 Hi

 
 
        
      
  
  

 The iterator is returning a string value on each iteration - what's the
 incantation to get the value of  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-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


>>> 
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 


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

-- 
View this message in context: 
http://old.nabble.com/How-to-nest-Struts-Tags-tp27062761p27072759.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org