Re: Manage Sessions in Struts

2008-11-30 Thread Stewart Buskirk


Try using something built around the token method that is normally  
used to prevent double-submissions.


The opening of the second browser window or tab would presumably send  
a new request to the server which would reset the token or would  
itself be invalid when checking the token. This would invalidate  
further requests from one of the browser instances.


You may want to implement this as an interceptor if it's an  
application-wide requirement.


http://www.planetstruts.org/struts2-showcase/token/index.jsp

-Stewart

On Nov 30, 2008, at 9:33 AM, [EMAIL PROTECTED] wrote:


What?  Are there solutions that are not web-based?  :)



On Sun, Nov 30, 2008 at 6:11 AM, Paweł Wielgus <[EMAIL PROTECTED]>  
wrote:



Hi Dani,
the only solution i can imagine in this case is to invalidate session
from first browser when the same user logs in with the second browser
- it would require You to write such bussiness logic to make it work.
But then again You cannot (or it will be very hard to do)
differentiate if a request comes from first or second tab in ff.
So if it's a real problem/requirement You should probably use
something other than web based solution.

Best greetings,
Pawel Wielgus.

2008/11/30, Dani <[EMAIL PROTECTED]>:

Hi,

In my web application I have to manage sessions. An user can not  
login

from multiple browsers (just one session available per user). I have
read that if browser window is cloned (such as a new tab in  
firefox or
IE) the session is also cloned to this new tab so a user could  
have two
instances of the application, and that´s what i am trying to   
avoid.


I have been playing around with sessions ID but no luck...

Any suggestions to achieve this?

Thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Struts iterator -

2008-11-28 Thread stewart
I will be out of the office, and mostly without email access, until Dec 1.

Please contact the One World office, 605-845-7172, with any general needs, and 
Danny Nickels, [EMAIL PROTECTED], at the same number, for any technical or 
integration issues.

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: JSR268 - Portlet Plugin - does it support

2008-11-27 Thread stewart
I will be out of the office, and mostly without email access, until Dec 1.

Please contact the One World office, 605-845-7172, with any general needs, and 
Danny Nickels, [EMAIL PROTECTED], at the same number, for any technical or 
integration issues.

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ExecuteAndWaitInterceptor Issue - Not getting request object at some where

2008-11-27 Thread stewart
I will be out of the office, and mostly without email access, until Dec 1.

Please contact the One World office, 605-845-7172, with any general needs, and 
Danny Nickels, [EMAIL PROTECTED], at the same number, for any technical or 
integration issues.

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Dummy example Struts 2.0 - My Sql

2008-11-26 Thread stewart
I will be out of the office, and mostly without email access, until Dec 1.

Please contact the One World office, 605-845-7172, with any general needs, and 
Danny Nickels, [EMAIL PROTECTED], at the same number, for any technical or 
integration issues.

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Struts 2 s:select question

2008-06-12 Thread stewart
I will be out of the office, and mostly without email access, until June 17.

Please contact the One World office, 605-845-7172, with any general needs, and 
Danny Nickels, [EMAIL PROTECTED], at the same number, for any technical or 
integration issues.

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem in Parameter passing.

2007-08-30 Thread chris . stewart
Shaik,

Assuming you are using Struts1, you need to define your data in a struts 
ActionForm class.  Make sure that the name of your variable is the same in 
the ActionForm as in the jsp control, and then you will be able to access 
it using the form object from within the execute method of your struts 
Action class.  Make sure that you have defined a setter and getter for the 
variable in your Action Form.  Then you will be able to easily reference 
the same data in the jsp, the Form class, and the Action.
For example...
 
<%-- The name attribute above is not needed as it is assumed to be the 
ActionForm if not specified -->

public class YourForm extends ActionForm {
...
private String variable1;
...
public String getVariable1() {
return variable1;
}
public void setVariable1(String variable1) {
this.variable1 = variable1;
}...
}
public class YourAction extends Action {
public ActionForward execute (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
...
YourForm yourForm = (YourForm) form;
...
String yourString = yourForm.getVariable1();
... 
}
Regards,
Chris Stewart



"Subhani Shaik" <[EMAIL PROTECTED]> 
08/30/2007 09:04 AM
Please respond to
"Struts Users Mailing List" 


To
user@struts.apache.org
cc

Subject
Problem in Parameter passing.







Hi,

I have a problem while passing some data from my JSP to Action action 
class.

I have a JSP in which I have a text field. Whwn I submit the page, I need 
to
get the text entered in the JSP into Action. I read in a article that if i
implement ParameterAware interface to my action class and override the
setParameter() and getParameter() methods, i would get the JSP data into
parameters (Map). I tried this and my parameter map is becoming empty.
I have mapped interceptor in my struts.xml action mapping.

Could you plese help me out in resolving this?

-- 
View this message in context: 
http://www.nabble.com/Problem-in-Parameter-passing.-tf4354138.html#a12406757

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Multiple Struts Config - Using the form tag

2007-08-29 Thread chris . stewart
Hi all,
 
I have an application which uses multiple struts-config files.  I'm trying 
to add a new one in which there will be an action which I want to be 
called when a particular jsp submit button is depressed.  As I would with 
a single struts-config file, I'm just constructing a form tag like this:

where someAction is defined in struts-module2.xml
The web.xml defines the second module like this:

config
/WEB-INF/config/struts-default.xml


config/module2
/WEB-INF/config/struts-module2.xml

When I run the jsp, it can't find the action.  I highly suspect this is 
because the struts custom tag library is building a URL for the action 
based on my web-context and not including the module name.  Then it is 
looking for the URL.  Of course it isn't found because the URL should 
include the module name which in this case is 
"/context/module2/someAction.do".  I would think though that struts is 
smart enough to manipulate the URL until it finds a config file that 
contains the action!  The error message I get is:
Error 500: Cannot retrieve mapping for action: "/someAction" 
I can make the error go away buy putting the action in the default 
struts-config.  I could deal with this using a javascript submit button, 
or some other creative solution, but I'd rather do it the "right" way. Any 
ideas? Is this a bug?

Regards,
Chris

[S2] Using method parameters in the s:if tag

2007-05-04 Thread Thomson, Stewart
Hello

 

Is it possible while using the 

   some html



 

 

Thanks



Re: Conditional validation for mask, date, integer etc

2005-10-19 Thread Stewart Cambridge
On my current project I've written a validation method that
dynamically invokes other validation rules depending on the String
returned by bean.getDepends()

It's used with indexed properties where the fields for the form to
fill in are configurable and come from a database.

Is that what you're after?

Stew

On 19/10/05, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>
> I'm wondering if there is a way to define conditional validation for mask,
> date, integer etc in validation.xml. I know there is a "validwhen", but it
> only checks for the condition as defined by the "test" variable. What I
> want is to perform the mask, date validation only some conditions are met.
> I wonder if there is a way to do that? Any points are welcome.
>
> thanks,
> Saul
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Struts code or 1.2.8?

2005-10-14 Thread Stewart Cambridge
I customised the validator just yesterday because it stops at the
first error when using List-backed forms and indexedListProperty and I
wanted it to run all validations down the page.
I tried to extend the relevent class, but found too many methods were
private or package access, rather than protected.
So I just customised it and re-compiled.

I sent a mail to the dev-validator list, but got no replies.

The hack is based on this email I found through google, except I just
removed the offending lines of code completely!

From: Bill Siggelkow <[EMAIL PROTECTED]>
Subject: [Validator] Indexed properties
Date: Thu, 12 Aug 2004 16:23:17 GMT
Prev Next Prev by Thread Next by Thread



I have been working with indexedListProperty in Struts 1.2 (using
Validator 1.1.3, I believe). Suppose I have the following validation:






minlength
5




Now, when I validate the form, if the minlength validation fails on one
of the indexed properties, then none of the rest of the partNumber
fields are checked for minlength.

I am using Struts and I was trying to output the error message beside
the property using html:messages -- the result is that the error message
is only generated for the first property that fails.

For what its worth, I did hack a fix -- I changed the

ValidatorResults validate(Map params, Map actions) method in the Field
class [org.apache.commons.validator.Field].

Basically where it had (on line 724):
-
 if (!good) {
 return allResults;
 }


I made it ...
-
 if (!good && numberOfFieldsToValidate <= 1) {
 return allResults;
 }


This worked -- in other words I get all the messages generated for each
field if the field is indexed.

Any opinions on ramifications of making this change or other possible
solutions? I have not messed at all with the client-side javascript so I
am not sure what the behavior is like there.

Bill Siggelkow


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



On 14/10/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
> Does anyone ever run any custom versions of Struts or
> the Commons library? The reason I ask is because the
> bug that I need fix (it is now fixed) in Commons
> Validator isn't released for the Struts 1.2.x branch,
> but most likely will be released with Struts 1.3
> Well I don't like using release 1 of anything :-) I
> wouldn't want to upgrade to Struts 1.3 until it at
> least gets into version 1.3.3 or something - the
> theoretical risk for large bugs is high... Just think
> of how many releases were for Struts 1.2!
>
> So what's the right solution here? I would like to see
> a Strut 1.2.8, as I said, with an upgraded Commons
> Validator too. Do I just compile a custom version of
> Validator for myself? I'd like to hear opinions.
>
>
>
> __
> Yahoo! Music Unlimited
> Access over 1 million songs. Try it free.
> http://music.yahoo.com/unlimited/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSF vs Struts

2004-07-18 Thread Jeff Stewart
I've been monitoring this discussion. I for one like using the struts 
html  tags over the JSTL/JSF semantically strange tags.
For one thing, feedback from the HTML developers I work with, prefer 
html:interate  this over the {c:jstl } garboono.
I mean, isn't this a big motivation why Struts was created.

Craig McClanahan wrote:
On Sun, 18 Jul 2004 23:56:55 -0400, Rick Reumann <[EMAIL PROTECTED]> wrote:
 

Craig McClanahan wrote:
   

For applications you are about to start on, if it is your intent to
use the Struts HTML tags for your view tier, you should review that
decision in the light of the developments of the last few months,
since the JSF spec went final, to say nothing of the availability of
alternative view tier technologies (XML, Velocity, ...) that work with
Struts as well.  If these tags work for you, that's fine ... but be
aware that you are buying in to a mature technology that is unlikely
to change much in the future.
 

Craig, can you elaborate on this a bit more? I'm confused because if you
went with a different front end presentation other than JSP and Struts
HTML form tags, why would it matter that you chose Struts HTML tags for
the JSP portion?
   

If you choose Struts HTML tags for your presentation, you're stuck
with what Struts provides.  Since Struts has no user interface
component model of its own, that has led to a variety of ad hoc
solutions for more complicated requirements.
If you choose JSF components, not only are you not stuck with what
Struts provides (because the JSF API standards are common -- and there
will be ***lots*** of third party components built on top of this
standard), you're not stuck with JSP either.  See below for more.
 

If you later chose an XML/XSLT or Velocity
(yuk:)solution for your view you'd end up scrapping the JSPs altogether
anyway so why would it matter what tags you used to build the JSPs that
you would be replacing? Or are you basically saying to not even bothr
using JSPs for a front end view? (I've seen good velocity templates and
I'll take a *clean* JSP using JSTL and tags over Velocity any day of the
week). Thanks for your thoughts and all your work on Struts, JSF,
Tomcat, etc.
   

The Struts HTML tags are very much specific to JSP ... indeed, their
very implementation is as instances of JSP custom tags.  You can't use
them at all without buying in to JSP as a display technology.  And,
for various reasons, more than a few loudmouths :-) in the Java
community do not like JSP at all.
With JSF, however, the situation is different.  Every JSF component
is, at its core, just a JavaBean ... it doesn't care what technology
is used to ultimately manage the page.  Yes, we provide JSP tag
wrappers around all the standard components (because that addresses
the need of a very large portion of the marketplace), but it's not
required.  The reason is that JSF provides a pluggable ViewHandler
implementation ... the default one does RequestDispatcher.forward()
calls (just like Struts does), making it very easy to use JSP, but
this is by no means required.
You like Tapestry style separation of the component tree definition
from the static HTML text?  That's not hard ... go get Hans's JSF book
and read the last chapter, to get you 80% of the way to a robust
ViewHandler solution.
Maybe you'd prefer XForms?  Go for it ... writing a ViewHandler that
transforms your favorite way of representing a component tree into an
XForms document is MMP (Merely a Matter of Programming :-).
Or, maybe you'd prefer an XML based solution that has all the
component stuff in a single file, and you're contemplating an XSLT
based solution that transforms component definitions into the
corresponding HTML.  Go for it.  (Of, course, if you use the XML
syntax for JSP pages plus JSF component tags, you get this pretty much
for free ... oops, sorry, forgot you might be one of those that
doesn't like JSP :-).
The basic point is, JSF is not restricted to using JSP as the view
tier ... although, for obvious market share reasons (the number of
current Java developers that use JSP dwarfs the number that use other
view technologies) JSF makes this very easy.
 

--
Rick
   

Craig
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



html:image question

2004-07-15 Thread Jeff Stewart
How can I pass parameters in a 
I have four of these that will basically do the same thing, issue a 
query. But, the query is parameterized.
It make little sense to do it the Husted way and have multiple image  
bean buttons to represent which html:image
was selected. IMHO, that approach is too much like hard coding. Any 
suggestions would be greatly appreciated.

Thanks in advance.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]