Re: Linking to another application

2011-06-24 Thread Greg Akins
Dave's probably right about a missing abstraction.

How about if the RequestManager (That's App1, right?) has a service
for accepting posts from the RequestHandler (App2, right?).  Then you
can deploy new forms to RequestHandler and RequestManager just accepts
any form POST from that application?

RequestManager needs to know what type of interface it's expecting..
so there probably needs to be some commonality between the forms in
RequestHandler.. that's the abstraction that needs defined.

Am I on the right track, or still missing something?

-- 
Greg Akins
http://twitter.com/akinsgre

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



Re: Linking to another application

2011-06-24 Thread Greg Akins
> On Fri, Jun 24, 2011 at 6:48 AM, Patrick McCourt  wrote:
>> I’ve got 2 Struts 2 applications running on Tomcat 6.0.
>>
>> In summary the main application is a manager application for requests
>> in our company, application 2 is a handler for a specific request
>> type.
>>
>> I want to make a link to go to that application whilst keeping the
>> information from the session in the first. I've only started working
>> with Tomcat and Struts this week so I am completely lost on how to do
>> this.

I think I need more details.. however, it sounds like you just need to
not think about integrating the two apps at the session level and
treat them like two different web applications.

Use web services to send the requests from one app1 -> app2; then save
the responses in app1?

In your case, maybe app2 can just be a web API (RESTful, or WS*) without any UI.

-- 
Greg Akins
http://twitter.com/akinsgre

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



Re: Problem with OGNL in FieldExpressionValidator

2011-04-30 Thread Greg Akins
Setting up a test app and trying to verify.

I suspect I'm doing something wrong elsewhere.

My test app has expression=("#session.isSet)

where session.put("isSet", true) is called in the index.action

And everything seems to work as expected.

I probably just needed a good night's sleep.. Thanks for listening.

-- 
Greg Akins
http://twitter.com/akinsgre

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



Re: Problem with OGNL in FieldExpressionValidator

2011-04-29 Thread Greg Akins
On Fri, Apr 29, 2011 at 7:23 PM, Okan Özeren  wrote:
>
> Hi,
>
> I didn't read all of these, but maybe there are some usefull tips in this 
> article:
> http://www.opensymphony.com/xwork/wikidocs/ExpressionValidator%20Tips.html


 Not quite.  Thanks though.

 That article is mostly about the ExpressionValidator; I guess I need
more OGNL help.

 I've always had a hard time understanding OGNL, so I'm sure I'm
making a mistake there.

 In this case, the session has the right value when the setter is
executed, but the OGNL expression #session.birthYearEnabled is null
(or seem to be null)

 I've tested this by executing the action.execute() and by calling the
annotations from a JUnit Test.

--
Greg Akins
http://twitter.com/akinsgre

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



Problem with OGNL in FieldExpressionValidator

2011-04-29 Thread Greg Akins
Can anyone help me understand how to use OGNL to capture session data in
this annotation?

I'm trying to use FieldExpressionValidator   The Annotation has this
[expression = "!birthYearDisplayed || !birthYear.equals('')"]

birthYearDisplayed is on the session and set to true

When I execute the code, the annotation logs "WARN - Got result of null when
trying to get Boolean."

I also tried #session.birthYearDisplayed & #session['birthYearDisplayed']

Struts 2.2.1
-- 
Greg Akins
http://twitter.com/akinsgre


Re: Using Strut in Desktop Application

2011-04-19 Thread Greg Akins
On Tue, Apr 19, 2011 at 8:40 AM, Alok  wrote:

> Hi Team,
>I am working on a Desktop application. I would like to use Strut
> frame in it. Is it possible?
>
>
I noticed you also posted this question, regarding Maven, to the Maven list.

Struts is a web framework afterall.  Are you hoping to use some of the
controller aspects in a Desktop application?

Maybe it would be better if you explain more about what you're hoping to
achieve by integrating Struts into a Desktop application.




-- 
Greg Akins
http://twitter.com/akinsgre


Re: Help with JQuery plugin

2011-02-18 Thread Greg Akins
On Fri, Feb 18, 2011 at 3:40 AM, Johannes Geppert  wrote:
>
> what exactly is the problem?
>
> i never have a problem with forms inside of the dialog.
>
The example you posted doesn't work for me.. I'm looking through the
wiki and not finding anything similar

When I try what you suggested the form appears on the page and not in
the dialog.

> http://code.google.com/p/struts2-jquery/wiki/DialogTag
>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
> 
>  
>    
>  
>  
>    
>     
>       
>       
>     
>   
>  
> 
>
> Johannes
>
>
> akinsgre wrote:
>>
>> I'm trying to implement a modal dialog in a Struts2 application.
>>
>> I found the struts2-jquery-plugin.
>>
>> What I'm not sure about is how to implement a dialog that contains a
>> form.  I'm trying to implement a feature to edit the value in a page
>> by displaying the dialog with a  and submitting that form to
>> an action as the dialog is closed.
>>
>> The examples in the struts-jquery-plugin wiki don't seem to cover this
>> case; though I've been fighting this (along with some other attempts
>> using SimpleModal) for a day now and am hoping someone can point me in
>> the right direction.
>>
>> Thanks.
>>
>>
>>
>> --
>> Greg Akins
>> http://twitter.com/akinsgre
>>
>> -
>> 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/Help-with-JQuery-plugin-tp30954067p30956812.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
>
>



-- 
Greg Akins
http://twitter.com/akinsgre

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



Help with JQuery plugin

2011-02-17 Thread Greg Akins
I'm trying to implement a modal dialog in a Struts2 application.

I found the struts2-jquery-plugin.

What I'm not sure about is how to implement a dialog that contains a
form.  I'm trying to implement a feature to edit the value in a page
by displaying the dialog with a  and submitting that form to
an action as the dialog is closed.

The examples in the struts-jquery-plugin wiki don't seem to cover this
case; though I've been fighting this (along with some other attempts
using SimpleModal) for a day now and am hoping someone can point me in
the right direction.

Thanks.



-- 
Greg Akins
http://twitter.com/akinsgre

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



XSS Validation

2011-02-10 Thread Greg Akins
I'm looking to do some general input santization on a Struts2 application.

Thinking that the OWASP validators might be a good place to start;
maybe along with a Struts CustomValidator

Has anyone done anything like this?  Does anyone have some advice for
providing "general" protection againts XSS and other types of
non-checked input vulnerabilities?

-- 
Greg Akins
http://twitter.com/akinsgre

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



Re: Problem with SessionAware across a redirect

2010-12-30 Thread Greg Akins
On Thu, Dec 30, 2010 at 10:42 AM, Greg Akins  wrote:
> I have an action which implements SessionAware  When that action is
> redirected to, the session map is null.

Nevermind.. I'm an idiot.  Forgot to include the default-stack when I
added an interceptor.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Problem with SessionAware across a redirect

2010-12-30 Thread Greg Akins
I have an action which implements SessionAware  When that action is
redirected to, the session map is null.

I know that request information isn't persisted across redirects, but
don't expect to lose Session information.

Maybe it's something stupid I'm doing?   Any advice?

Struts 2.2.1 and Tomcat6..

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: namespace vs package

2010-12-27 Thread Greg Akins
On Mon, Dec 27, 2010 at 1:05 PM, Dave Newton  wrote:
> It *is* the default namespace, but almost always ends up being confusing at
> some point. The minimal namespace I recommend is "/".

OK.. that makes sense.

> There's no direct relationship between package and namespace other than a
> package has a namespace--I always figured it was to allow decoupling of
> paths and packages.

Here is what I'm having a tough time understanding.

Those Actions in sigmm.actions are in the default namespace; and are
in the a package by virtue of the  in the
struts.xml in which they're configured.

If I'm using the Convention plugin, is there a "default" package,
assuming I haven't used @ParentPackage or the
struts.convention.default.parent.package prop in struts.properties?

What I want to do, if it makes sense, is have an Action in
sigmm.actions.mobile and an interceptor class in sigmm.interceptors
I'd expect the actions in mobile to be in the /mobile namespace; think
they'd be in the sigmm.actions.mobile package and don't know what
package/namespace the Interceptor would be in (Other than the java
package sigmm.interceptors).

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: namespace vs package

2010-12-27 Thread Greg Akins
On Mon, Dec 27, 2010 at 11:21 AM, Maurizio Cucchiara
 wrote:
> Did you try ParentPackage Annotation?
> Also I'm not sure that empty string for namespace is the best value.

No.

I put them in the same package to get them working and figured I could
experiment from there.

I'm still a little confused about the relationship between namespace &
package.  I thought the struts docs suggested an empty string as the
"default" namespace.

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



namespace vs package

2010-12-27 Thread Greg Akins
Having trouble getting interceptors to work.  I think it's because my
namespace and packages aren't aligned correctly.  Using Convention
plugin and when I start the app I get an error that ref-name can't be
found.

My interceptor is defined in struts.xml








 














/WEB-INF/content/custom-error.jsp



Action is

package com.fiserv.sourceone.sigmm.actions.mobilemoney;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;

@Namespace("")
@InterceptorRefs({
@InterceptorRef("login")
})
public class MaintainParameters extends ActionSupport {

private static final long serialVersionUID = -161735293208543752L;

@Override
@Action(value = "maintain-parameters", results = {
@Result(name = SUCCESS, location =
"auth/maintain-parameters-success.jsp" ) } )
public String execute()
    {
    return SUCCESS;
}
}



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Authorization/ Authentication

2010-12-27 Thread Greg Akins
On Mon, Dec 27, 2010 at 8:36 AM, Jordi Fernandez
 wrote:
> Have you considered Spring Security?
> http://static.springsource.org/spring-security/site/

No.. I'll have to read a bit more; but my first guess is that I'd have
to do some refactoring of some legacy code ( I need to use the same
underlying data / logic to perform AA in another sibling application.

Basically I was wondering what was "built-in" to struts to handle this
and find out if I can adapt that to my current app

I think all I need to do is write a LoginInterceptor to check for a
login, and redirect to the login page if the user isn't authenticated.
 The security for this application is binary so I don't need anything
additional for Authorization.

Thanks for pointing it out though.. I'll definitely do some research into that.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Authorization/ Authentication

2010-12-27 Thread Greg Akins
On Mon, Dec 27, 2010 at 8:59 AM, Dave Newton  wrote:
> (Let me clarify slightly.)
>

OK, I think I understand.  The Interceptor should check if the session
is authenticated, but should perform the Login.  That's what I would
have done, so maybe that's what confused me.

Thanks for clearing that up.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Authorization/ Authentication

2010-12-27 Thread Greg Akins
I'm just starting to research the appropriate Struts2 way to do
Authorization/Authentication.

Looks like a LoginInterceptor on the default stack is the way to go
(though I found a post at javaranch, by Dave Newton  -
http://www.coderanch.com/t/438760/Struts/Struts-Authentication-Authorization
- that confused me a bit).

I'm still Googling for some more information, but if anyone could
point me to a specific resource it would be greatly appreciated.

Thanks!

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: EmailValidator

2010-12-13 Thread Greg Akins
On Mon, Dec 13, 2010 at 1:50 PM, Brian Thompson  wrote:
> I've looked into this before.  The email validator resolved down to some
> really old code in XWork with a regex that looked something like this:
>
> [a-z0-...@[a-z0-9].[a-z]^3

Thanks.. I hadn't looked at the source.. It looks like the API docs
don't quite match the source then, either.
-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: EmailValidator

2010-12-13 Thread Greg Akins
On Mon, Dec 13, 2010 at 12:20 PM, Dave Newton  wrote:
> IIRC the default email validator isn't as robust as the page- long RFC email
> regex. I'd suggest either a patch, ora custom validator.
>

Thanks.  I'll try to submit a patch after I get something more robust working

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



EmailValidator

2010-12-13 Thread Greg Akins
I just tried to use angrygreg+...@gmail.com as an email , and the
Struts EmailValidator doesn't like it (Struts 2.2.1)

I'm not that great at reading regexp.. it looks like maybe the regexp
should support that email address.. but I'm not sure.

Can anyone comment on whether EmailValidator is the best approach?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Cancel in a form re: bypass Validation

2010-12-10 Thread Greg Akins
Thanks Li.. you're correct.   And I'm still wondering why the form in
my Application won't display fieldError messages when I use only
Serverside validation.

If, on the s:form, I use validation="true" the javascript is included
to do validation, and the errorMessages automagically appear
(theme="xhtml")

However, if I don't use   the validation
still works (page result is INPUT) but the error messages aren't
rendered.  When I create a simple "Hello World" app, it does work; and
I can't figure out which bit of Struts I've broken in trying to get my
application's validation to work.

On Thu, Dec 9, 2010 at 7:14 PM, Li Ying  wrote:
> I think Michal was right.
>
> If you don't want execute validation for some Action Method, the
> annotation "@SkipValidation" is a good solution.

Sure.. but serverside validation (which is affected by the annotation
(either SkipValidation, or the interceptorref) works.

> And, in your case,
> I noticed that, your server side action is doing nothing when the
> [cancel] button clicked.
> I suggest you can put a html Link for your [cancel] button, instead of
> a submit button.

Right.. and a links works.. but I'm trying to understand how to get
the button to work, in case I have to use a cancel button either in
this case, or in the future.

>
> So, when it be clicked, browser will jump to the next page, and your
> form will not be submitted.
> And of cause, the validation will not be executed.
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Bad Struts Day

2010-12-09 Thread Greg Akins
Not sure what is best here.

I need to create an URL with a value from my default resource bundle in the URL

For example  returns logo.gif

I need to do something like  that will
return my relative url with the value of IMAGE appended.

So if I'm at /App/11/index.jsp my img src will be /App/11/logo.gif

If I simply do  oftentimes the
jsessionid value get's placed on the end of the url and corrupts the
intended results.

Using struts 2.2.1 .. any suggestions?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Cancel in a form re: bypass Validation

2010-12-09 Thread Greg Akins
On Thu, Dec 9, 2010 at 3:26 PM, Michal Ciasnocha  wrote:
> Hi Greg,
>
> I use in my code @SkipValidation annotation for method which I don't want to
> validate. For me it is easier than use interceptors.
>
> @SkipValidation
> public String cancel() {
>    return SUCCESS;
> }
>
> The second part - redirect - I hope is correct.
>

I think the problem is coming down to whether I use validation=true on
the form.. If I don't, I'm not getting the errormessages/labels.. if I
do, then I get client-side javascript validated that isn't affected by
the serverside annotations.

Serverside validation is fine if I can figure out why the errormessage
labels are disappearing.. Seems like it might be a function of using
the Convention plugin.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Cancel in a form re: bypass Validation

2010-12-09 Thread Greg Akins
I need to have a "Cancel" button on a form that skips the validation
(Struts 2.2.1).  This seems harder than it should be and maybe I'm
missing something.

I've read a few posts about this and ended using the validation
interceptorref to get this to work.

I've had problems getting the interceptorref mechanism to work

@Action(value = "hello-world-cancel",
interceptorRefs = { @InterceptorRef(value = 
"validation", params = {
"excludeMethods", "cancel" })},
results = { @Result(name = SUCCESS, 
location="/jsp/logon.jsp") })
public String cancel() throws Exception {
LOG.debug("Cancelled", "The form has been cancelled");
return SUCCESS;
}

The problem is.. I've got this working as part of the Maven
struts-archetype-starter application.  However, I can't manage to get
the same thing working on my application

Bother are using theme="xhtml".. but my application will only do the
Error Messages and labels if the validate="true" is set on the form.
However, setting the validate=true on the form forces client-side
javascript to be built which is run everytime the form is submitted,
even if it's submitted from the cancel button.

The HelloWorld application looks like it's using serverside validation
(since there isn't any javascript in the page.. but the error messages
and labels still appear).

Any thoughts on what I might be missing?
-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Question about OGNL / EL

2010-12-06 Thread Greg Akins
Dave.  The partnerId is being set, in the action class using
session.put("partnerId", "11")

On Mon, Dec 6, 2010 at 1:27 PM, Alfredo Manuel Osorio Martinez
 wrote:
> Try replacing %{partnerId} with %{#session.partnerId}

Thanks!  That worked


>
> Alfredo Osorio
>
> -----Mensaje original-
> De: Greg Akins [mailto:angryg...@gmail.com]
> Enviado el: Monday, December 06, 2010 11:16 AM
> Para: user@struts.apache.org
> Asunto: Question about OGNL / EL
>
> This might not be specifically a OGNL question.  I've got some code
> that doesn't appear to behave correctly.
>
>  -
> ${partnerId}
> 
>
> When I open this page the title includes the partnerId but the url
> doesn't
>
> partnerId is set on the Session.  I'm wondering if it isn't set when
> the  tag is evaluated, but is when the EL expression is
> evaluated.
>
> Any other idea why this wouldn't be working?
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> -----
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Question about OGNL / EL

2010-12-06 Thread Greg Akins
This might not be specifically a OGNL question.  I've got some code
that doesn't appear to behave correctly.

 - ${partnerId}


When I open this page the title includes the partnerId but the url doesn't

partnerId is set on the Session.  I'm wondering if it isn't set when
the  tag is evaluated, but is when the EL expression is
evaluated.

Any other idea why this wouldn't be working?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Initial setup

2010-11-22 Thread Greg Akins
On Sun, Nov 21, 2010 at 11:12 PM, Brajesh Patel
 wrote:
> Hi Dave,
> Thanks for your quick support.
>
> I am going for 2.2.1 that jar I have downloaded, also please provide doc
> where I found it.

There is a documentation link on the http://struts.apache.org site.

But for your convenience try this
http://struts.apache.org/2.2.1/docs/getting-started.html


-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Problem with Validation "lifecycle"

2010-11-19 Thread Greg Akins
On Fri, Nov 19, 2010 at 11:43 AM, Greg Lindholm  wrote:
> I wrote this to solve the problem of preserving messages across a redirect:
>
> http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/
>

Thanks Greg.  That looks like exactly what I was looking for.  One
question to you, or to the list, someone that commented on your blog
mentioned the MessageStoreInterceptor.  Any pros or cons of using that
over your interceptor?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Problem with Validation "lifecycle"

2010-11-19 Thread Greg Akins
Thanks for the response

On Fri, Nov 19, 2010 at 11:28 AM, Maurizio Cucchiara
 wrote:
> As far I can remember actionError are stored in struts stack, so I guess
> they are per-request.

That's what I thought.

> Also, redirect action create a new request, so you can share AE in a
> standard flow.

I CAN share actionErrors in the standard flow, but if I use
redirectAction I lose the original request, right?

> Can't you do without redirect for the input result?

The problems is that when I create the jsp, I set values for whether
the fields are to be displayed.  Since those are set in the action, if
I skip that action the fields are displayed.

The only other thing I can think of is to set the display in the other
action (the one that is redirecting from).. but since I'm falling out
of the interceptor stack and not getting into the execute method on
the action, I'm not sure of how I'd do that either.

> 2010/11/19 Greg Akins 
>>
>> I've written an action, with validation, that uses a redirectAction
>> instead of a .jsp for the INPUT result.
>>
>> When the final INPUT jsp is displayed, the actionErrors aren't
>> present.  I believe this is because the action I'm redirecting to
>> "clears" the actions before the jsp is displayed.  If I save an
>> actionError on the session, I can retrieve it in the final error...
>> but this seems less than ideal, and I'm not sure how to get to the
>> annotation based validators ( I added a session.put() in the
>> validate() method.
>>
>> Is there a way to "carry" the errors across actions in this case? The
>> INPUT needs to redirect to an action because the action determines
>> whether certain fields need displayed.. if the INPUT goes straight to
>> a jsp, the jsp is blank because of the logic I'm using to display
>> fields.
>>
>> Struts 2.2.1
>>
>> --
>> Greg Akins
>>
>> http://insomnia-consulting.org
>> http://www.pghcodingdojo.org
>> http://pittjug.dev.java.net
>> http://twitter.com/akinsgre
>> http://www.linkedin.com/in/akinsgre
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
>
>
> --
> Maurizio Cucchiara
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Problem with Validation "lifecycle"

2010-11-19 Thread Greg Akins
I've written an action, with validation, that uses a redirectAction
instead of a .jsp for the INPUT result.

When the final INPUT jsp is displayed, the actionErrors aren't
present.  I believe this is because the action I'm redirecting to
"clears" the actions before the jsp is displayed.  If I save an
actionError on the session, I can retrieve it in the final error...
but this seems less than ideal, and I'm not sure how to get to the
annotation based validators ( I added a session.put() in the
validate() method.

Is there a way to "carry" the errors across actions in this case? The
INPUT needs to redirect to an action because the action determines
whether certain fields need displayed.. if the INPUT goes straight to
a jsp, the jsp is blank because of the logic I'm using to display
fields.

Struts 2.2.1

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Another stupid question re: Interceptors

2010-11-17 Thread Greg Akins
On Wed, Nov 17, 2010 at 8:14 AM, Li Ying  wrote:
> I suggest you to do these things in the following way:

This is where I think I messed things up.  My identifyAction didn't
have setters/getters for the fields because the verifyAction captured
the results of that input.

Consequently, when I redirected to IdentifyAction to get the
identify-success.jsp, the values COULDN'T be available.  (Doh!!)

You're suggestion below sounds much more reasonable though.  Thanks
for everyone's help and patience.

>
> (1)put 2 method in IdentifyAction.
> The first [execute] method returns [input],
> show the input page to user.
>
> (2)In the  Identify-input.jsp,
> submit fields to [IdentifyAction] itself, but another method: [verify]
>
> (3)when validation fails, the result will be [input] automatically,
> which means, the input page will be shown again.
>
> (4)when validation validation passes, your method [verify] will be
> executed. You can implement your business logic in it. If the
> verification fails, you can return a result [input], and back to the
> input page again. If the verification pass, you can return another
> result, and forward(or redirect) to the next action; or you can return
> a result [success], show the Identify-success.jsp page.
>
> (5)another thing need to notice is, method [execute] should be marked
> by [skipvalidation] annotation
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Another stupid question re: Interceptors

2010-11-16 Thread Greg Akins
Maybe I'm doing something really stupid here.

I have two pages / actions (IdentifyAction -> identify-*.jsp ->
VerifyAction -> verify-*.jsp)

When a user completes the fields on identify-sucess.jsp and submits
the form to VerifyAction.. the validate() method on VerifyAction
fails.  I want the user to be returned to identify-success.jsp to fix
the appropriate fields.

Am I doing this wrong?

On Tue, Nov 16, 2010 at 4:17 PM, Gena Ganebnyi  wrote:
> Why not to name your original page page-input.jsp?
>
> On Tue, Nov 16, 2010 at 10:31 PM, Greg Akins  wrote:
>>
>> Does that mean that I can't use the Convention plugin if I want the
>> Validation Interceptor to behave like I'm expecting?
>>
>> It seems like the information I've read so far implies that the
>> Validator Interceptor will allow the "submitting" page to appear with
>> the information filled in and the error messages displaying where
>> appropriate.  But if I follow the Convention plugin and use it's
>> action/results then I don't get the same behavior.
>>
>> Am I missing something, or is this correct.
>>
>> On Tue, Nov 16, 2010 at 3:06 PM, Gena Ganebnyi 
>> wrote:
>> > When validation fails, intercept returns "INPUT" on behalf of the
>> > action.
>> > That is why convention plugin takes you to page-input.jsp
>> >
>> > On Nov 16, 2010 9:06 PM, "Greg Akins"  wrote:
>> >> I'm trying to get validation working.. should be pretty simple.
>> >>
>> >> It looks like if my validation fails Struts should auto-magically take
>> >> me back to the originating jsp. Instead Struts keeps wanting to find
>> >> a page-INPUT.jsp to match the INPUT return type.
>> >>
>> >> I'm using the convention plugin and using annotations, rather than
>> >> validator.xml, for validations. Struts 2.2.1. There is no struts.xml
>> >> file in the project (everything is through annotations.).
>> >>
>> >> Any hints?
>> >>
>> >> --
>> >> Greg Akins
>> >>
>> >> http://insomnia-consulting.org
>> >> http://www.pghcodingdojo.org
>> >> http://pittjug.dev.java.net
>> >> http://twitter.com/akinsgre
>> >> http://www.linkedin.com/in/akinsgre
>> >>
>> >> -
>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> For additional commands, e-mail: user-h...@struts.apache.org
>> >>
>> >
>>
>>
>>
>> --
>> Greg Akins
>>
>> http://insomnia-consulting.org
>> http://www.pghcodingdojo.org
>> http://pittjug.dev.java.net
>> http://twitter.com/akinsgre
>> http://www.linkedin.com/in/akinsgre
>
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Another stupid question re: Interceptors

2010-11-16 Thread Greg Akins
I'm trying to get validation working.. should be pretty simple.

It looks like if my validation fails Struts should auto-magically take
me back to the originating jsp.  Instead Struts keeps wanting to find
a page-INPUT.jsp to match the INPUT return type.

I'm using the convention plugin and using annotations, rather than
validator.xml, for validations.  Struts 2.2.1.  There is no struts.xml
file in the project (everything is through annotations.).

Any hints?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Putting an Image (in Bytes) on the session

2010-11-15 Thread Greg Akins
On Mon, Nov 15, 2010 at 12:49 PM, Jesse Hill  wrote:
>
> Also, is there a particular reason why the data needs to go in the session 
> instead of just adding a getImage() method to your action that will return 
> the data that you need?
>

You're right.  I don't need it in the session.  But that wasn't the big problem.

The problem I was having was returning the image bytes from an "in
page" mechanism rather than relying on a dedicated "image" servlet
that writes directly to the response output.

I ended up writing a BufferedOutputStream onto the request and then
embedding a 


--
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Putting an Image (in Bytes) on the session

2010-11-15 Thread Greg Akins
This seems like maybe I'm approaching it wrong.. but wondering if it's possible.

I'm wondering if I can put an image, in the form of a byte array, or
stream, that I can read with either a struts tag, jstl, or el

Thinking in my action

session.put("image", image.getBytes());

and in the .jsp

${image}

Thoughts on this, or other ways to do something similar?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Getting rid of session state

2010-11-01 Thread Greg Akins
I'm developing a new Struts2 application, am new to Struts2, and want
to reduce my dependency on the session.

What kind of "best practices" are folks using to move the type of
information that needs to be persisted during a session to other
mechanisms?

I can think of a few.. does anyone have any other ideas, or is there
just a standard Struts2 way to do this?

1.  Implementing something similar to ViewState in aspx
2.  Managing values by manually keeping them in the request
3.  Storing everything in a db and looking it up with each request
4.  Scope Interceptor

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Where is the JIRA?

2010-10-20 Thread Greg Akins
https://issues.apache.org/struts/ gives me a 404
-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: URLRewrite, maybe?

2010-09-20 Thread Greg Akins
I was hoping to use the ConventionPlugin.. but having that in the
struts.xml seems to work better, in this case, than having it in
UrlRewrite.

Thanks for the tip.

2010/9/20 Paweł Wielgus :
> Hi All,
> i'm using action configuration like this:
>
> < action name="/conference-photo/{conferenceId}/{photoId}"
> class="com.ppp.elsevier.struts.action.ConferencePhotoAction" >
>        < result type="stream" >
>            < param name="contentType" >image/jpeg< / param >
>        < / result >
>  < / action >
>
> So in your case it woud be:
> < action name="/{partnerId}/index"
> class="com.ppp.elsevier.struts.action.ConferencePhotoAction" >
> but if that rule have to work for every single action in your
> application automaticaly than maybe URLRewrite will be better.
>
> If You want to use struts based solution read more about it here:
> http://struts.apache.org/2.2.1/docs/wildcard-mappings.html
>
> Best greetings,
> Paweł Wielgus.
>
>
>
> 2010/9/17 Matt Meola :
>> I have used URLRewrite with struts2, and it works quite well.
>>
>>
>> On Fri, 2010-09-17 at 12:24 -0400, Greg Akins wrote:
>>
>>> I'm having a bit of a mental block on this one.
>>>
>>> Using Struts2, I want to redirect paths like
>>> example.com/Partner55/index.action to example.com/index.action after
>>> I've using a Filter to get the "Partner" value from the URL
>>>
>>> Can anyone help point me in the right direction?  Is URLRewrite the
>>> correct place to start?
>>>
>>
>>
>> --
>> Matt Meola
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



URLRewrite, maybe?

2010-09-17 Thread Greg Akins
I'm having a bit of a mental block on this one.

Using Struts2, I want to redirect paths like
example.com/Partner55/index.action to example.com/index.action after
I've using a Filter to get the "Partner" value from the URL

Can anyone help point me in the right direction?  Is URLRewrite the
correct place to start?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: URL "format" advice

2010-09-06 Thread Greg Akins
Thanks Dale and Jordi; I started using a Filter to determine, but
hadn't seen the wildcard mapping.  That looks like just what I was
looking for.

On Mon, Sep 6, 2010 at 9:28 AM, Dale Newfield  wrote:
> On 9/6/10 6:27 AM, jordi wrote:
>>
>> You can do that with wildcard mappings. I'm using Advanced wildcard
>> mappings
>> with regex... check it out
>>
>> http://struts.apache.org/2.x/docs/wildcard-mappings.html
>
> Especially if you couple that with the Url Rewrite Filter.
> http://www.tuckey.org/urlrewrite/
>
> -Dale
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



URL "format" advice

2010-08-25 Thread Greg Akins
I need to implement a webapp that uses the URL to determine the
"partner" that is accessing the application.  I'd like your opinion on
the way to do this that might work best with Struts.

Right now, we use a querystring parameter to set a session value that
is references throughout the application to determine the partner.

I can do that same thing with struts (ie., www.example.com/myapp?partnerId=8)

I am wondering if it might be better to create a URL like
www.example.com/myapp/8

Ultimately, it would be nice to map a url to a domain (ie.,
www.example.com/myapp/8 -> partner8.example.com

Ultimately, this would avoid problems with keeping the value in the
session, as it could always be retrieved from the URL

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-08-24 Thread Greg Akins
Yippee!!

After a little more Googling it occurred to me that the default might
be still set in struts.properties; it was.. and when I removed it my
DbResourceBundle started working

Thanks for bearing with me



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-08-24 Thread Greg Akins
On Tue, Aug 24, 2010 at 1:13 PM, Dale Newfield  wrote:
>>>
>>> struts.xml
>>> >> value="com.fiserv.sourceone.ribs.common.bundles.DbResourceBundle" />
>
> That constant has a String value.

>From what I've read, the struts.custom.i18n.resources constant usually
gets set to something like "global-messages" which translates to a
.properties file.  However, at the beginning of this thread I asked
about using ResourceBundle which loads from a database, and this usage
was suggested to me.  I'm not  sure how Struts is reconciling that
constant.. but expected it would either load the class there, or wait
until the first usage.
>
>>> index.jsp
>>> 
>
> And this is looking up the specified item in ApplicationResources.properties

OK, and maybe that's the problem, because I expected it to use the
resource bundle from struts.custom.i18n.resources
>
>
>> A followup to this:
>>
>> If I put a static initializer with a System.out.println in
>> DbResourceBundle, it never get's executed;
>
> Or the output isn't going where you expect it to.
>

Yeah, maybe.. though if I load that class directly I do see it on my
console (running the app with mvn tomcat:run )



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-08-24 Thread Greg Akins
On Tue, Aug 24, 2010 at 10:51 AM, akinsgre  wrote:
>
> struts.xml
>  value="com.fiserv.sourceone.ribs.common.bundles.DbResourceBundle" />
>
> index.jsp
> 
>

A followup to this:

If I put a static initializer with a System.out.println in
DbResourceBundle, it never get's executed; I'm not sure when I should
expect the class to get loaded, but it seems like the constant
declaration isn't doing anything right now.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-07-16 Thread Greg Akins
On Fri, Jul 16, 2010 at 9:24 PM, J_e_f_f  wrote:
>
> If you're specifying your DbResourceBundle class in the web.xml like:

   
>
>  value="com.insomnia.common.bundles.DbResourceBundle" />
>

Was that a typo?  Did you mean struts.xml?  I have it in struts.xml,
but it doesn't seem to be getting called.  Maybe it should be in
web.xml .. in that case as an init-param on the Dispatcher filter.
Right?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: [FRIDAY] Mime Type Validation

2010-07-16 Thread Greg Akins
I've used this before, and it seemed to work well.

http://jmimemagic.sourceforge.net

Some more alternatives are here

http://www.rgagnon.com/javadetails/java-0487.html

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-07-16 Thread Greg Akins
On Fri, Jul 16, 2010 at 8:21 AM, Mike Fotiou
 wrote:
> Finally, in the view, you must wrap an i18n tag for the text-based tags to 
> work properly:
>
> <@s.i18n name=".utils.content.DataResourceBundle">

This isn't working for me.

My DbResourceBundle is a class that extends ResourceBundle

I specify it as a constant in struts.xml and then wrap my s:text with
the s:i18n using the fully qualified class

When I load the page I get this logged message "WARNING: Could not
find method [getTexts('com.insomnia.common.bundles.DbResourceBundle')]"

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-07-16 Thread Greg Akins
Thanks Mike

On Fri, Jul 16, 2010 at 8:21 AM, Mike Fotiou
 wrote:
>  I implemented this by creating my own ResourceBundle implementation 
> ("DataResourceBundle").  This handles all of the database access and returns 
> the appropriate string to Struts by key when asked.
>

We already have a DataResourceBundle.. and I was hoping I could use
that.  So this is good news.

> Finally, in the view, you must wrap an i18n tag for the text-based tags to 
> work properly:
>
> <@s.i18n name=".utils.content.DataResourceBundle">

I'm new to Struts, so this might be a stupid question.. is there
anyway to define that globally?  I'm using SiteMesh, so maybe defining
it in a decorator might be good enough?

>
> -Original Message-
> From: Greg Akins [mailto:angryg...@gmail.com]
> Sent: Friday, July 16, 2010 7:58 AM
> To: user@struts.apache.org
> Subject: Re: Any way to load resources in java.util.ResourceBundle
>
> I'm resurrecting this message because I have the same need.
>
> I'm converting some code to Struts2, from a JSP/Servlet application.
> Currently we create bundles from a database, that have keys per customer and 
> language for most of the text in our application.
>
> A simple solution to this would be to override 
> LocalizedTextUtil.findDefaultText and add a call to our classes that load the 
> text into a ResourceBundle.
>
> However it doesn't look like there is anyway, in Struts 2.1.8.1 to use my own 
> version of LocalizedTextUtil.
>
> Does anyone have any thoughts on how I might do this?
>
> On Wed, Jan 27, 2010 at 12:43 PM, Bhaarat Sharma wrote:
>
>> We have seen situations where sometimes the global resource bundles
>> are lost intermittently for some sessions. We are in a
>> clustered/shared environment where multiple apps are deployed onto a 
>> GlassFishV2 server.
>> Multiple apps share the struts2 core jars.
>>
>> We have some pages where we have written a custom Resource loader and
>> everything looks fine on these pages. Problem is on pages that utilize
>> . Our properties files reside globally
>> in WEB-INF/lib
>>
>> Our custom resource loader works as follows in a JSP
>>
>> <%CustomMessageResrouce cusResource = new
>> CustomMessageResource("Resource")%>
>> <%= cusResource.getMessage("my.label.name")%>
>>
>> Java code for it looks like:
>> import java.util.ResourceBundle;
>> ResourceBundle resource = ResourceBundle.getBundle(baseName);
>>
>>
>> So we know that loading properties into resourcebundles and using them
>> as shown above works.
>>
>> My question is..can we do the same for struts2. Can we forcefully load
>> the resourcebundles inside java.util.ResourceBundle and then have them
>> be used in  tag?
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Any way to load resources in java.util.ResourceBundle

2010-07-16 Thread Greg Akins
I'm resurrecting this message because I have the same need.

I'm converting some code to Struts2, from a JSP/Servlet application.
Currently we create bundles from a database, that have keys per
customer and language for most of the text in our application.

A simple solution to this would be to override
LocalizedTextUtil.findDefaultText and add a call to our classes that
load the text into a ResourceBundle.

However it doesn't look like there is anyway, in Struts 2.1.8.1 to use
my own version of LocalizedTextUtil.

Does anyone have any thoughts on how I might do this?

On Wed, Jan 27, 2010 at 12:43 PM, Bhaarat Sharma wrote:

> We have seen situations where sometimes the global resource bundles are
> lost intermittently for some sessions. We are in a clustered/shared
> environment where multiple apps are deployed onto a GlassFishV2 server.
> Multiple apps share the struts2 core jars.
>
> We have some pages where we have written a custom Resource loader and
> everything looks fine on these pages. Problem is on pages that utilize
> . Our properties files reside globally in
> WEB-INF/lib
>
> Our custom resource loader works as follows in a JSP
>
> <%CustomMessageResrouce cusResource = new
> CustomMessageResource("Resource")%>
> <%= cusResource.getMessage("my.label.name")%>
>
> Java code for it looks like:
> import java.util.ResourceBundle;
> ResourceBundle resource = ResourceBundle.getBundle(baseName);
>
>
> So we know that loading properties into resourcebundles and using them as
> shown above works.
>
> My question is..can we do the same for struts2. Can we forcefully load the
> resourcebundles inside java.util.ResourceBundle and then have them be used
> in  tag?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Help with "Skinning"

2010-07-15 Thread Greg Akins
I looked at the Struts documentation for skinning and have one
question that I'm not sure can be addressed by Struts2

In my case I'd like to skin some of the pages, but not all.

So if my directory structure is something like

+ content
   - index.jsp
   + user1
   - about.jsp
   + user2
   - about.jsp

And the URL is http://localhost/user1/index.jsp

I would like to return content/index.jsp..

Does that make sense?  I can probably do this with some type of
filter, but wondered if Struts2 had a better mechanism

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Advice on new Project

2010-07-14 Thread Greg Akins
I've got a couple things that are requirements for a new project I'm
starting.  If anyone has any advice for some clean/simple way so to do
this in Struts2, I'd very much appreciate pointers to more
information.

First.. I'm new to Struts2, but have done a fair amount with Struts.

The app I'm writing has to be Internationalized, which by itself isn't
a problem.  It also is multi-tenant, which for us means that a single
app will serve multiple customers and each customer can specify their
own "Content" and styles.

Our current J2EE (Servlet/JSP) apps use a combinations of custom tags
that look up specific content in a database and a directory hierarchy
that serves html/css out of subdirectory depending on a Session
variable.

Any advice is appreciated.

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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