RE: Struts1 or Struts2

2009-06-25 Thread Mitchell, Steven
Chris,

My opinion is that you will take an initial productivity hit while the
team gets accustomed to the new JSP tags.  That is what took me the
longest. I also switched from Tiles to SiteMesh, which like much better.
My recommendation is to pick one person to do the first small, benchmark
application and then have that person mentor the rest of your team.

I went ahead and converted a couple of Struts 1 applications to Struts
2.  There is no business justification to do so, but it was an excellent
learning exercise.

The main thing I noticed when I converted my Struts 1 actions to Struts
2 was that they were much cleaner with Struts 2.  I standardized the
basic layout of my actions.

public String save() throws Exception {
  checkForActionErrors();
  if ( !hasActionErrors() ) {
   checkForFieldErrors();
   if ( !hasFieldErrors() ) {
  // do CRUD stuff here...
  return SUCCESS;
   }
prepare(); //re-populate stuff in Request scope
return INPUT;
   }
}
return ERROR;
}

Go for it!

Steve Mitchell
http://www.ByteworksInc.com
-Original Message-
From: CRANFORD, CHRIS [mailto:chris.cranf...@setech.com] 
Sent: Thursday, June 25, 2009 3:29 PM
To: user@struts.apache.org
Subject: Struts1 or Struts2


My company has used Struts1.1 and Struts1.2 for the development of our
widely used customer portal web application environment.  Recently, the
company has decided to migrate to a new back office solution and as a
part of this project, our customer portal application is needing to be
rewritten as well.  In an effort to remain on the latest and greatest
technology stacks, I am considering Struts2 (specifically 2.1.6) versus
staying on the Struts1.2 framework.  

Is there a huge benefit in moving to Struts2 for my development team?  
Will less development/configuration/maintenance be required?  


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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



Gracefully continuing an interrupted action flow

2009-06-19 Thread Mitchell, Steven
Is there a best practice for capturing a user's original destination
when interrupting a request with an interceptor with the intention of
allowing them to continue on their way later... like form authentication
does? In my case I have a "Cookie Enforcer Interceptor" that checks for
the presence of a preference cookie.  It sends the user to the
preference page if the cookie is missing, but should then send them back
to where they were trying to go once the preference value has been set.

My plan is to put a global forward name in the session that corresponds
to a global forward which redirects to some action (there are several
possible destinations). I can then add another interceptor that looks
for that session attribute, returning (and removing) the forward name if
present. That sounds workable, but not very elegant.  

Steve Mitchell
Byteworks, Inc.  




--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Performance issue with large data(such as images)

2009-06-10 Thread Mitchell, Steven
This is a little off topic, but can anybody recommend a photo resizing utility 
to run after the upload?  I too have a need to allow the user to upload a user 
photo, which could be stored in a BLOB, but I know it is not that simple.  Many 
sites do post processing to adjust the image resolution, size or even type, and 
some allow the user to crop the image as well. I'm curious if anybody has 
experience with an open source photo manipulation framework that plays well 
with Struts 2.

Steve Mitchell
http://www.Byteworksinc.com 

-Original Message-
From: Richard Sayre [mailto:richardsa...@gmail.com] 
Sent: Wednesday, June 10, 2009 12:41 PM
To: Struts Users Mailing List
Subject: Re: Performance issue with large data(such as images)

>Thanks, Rich,

I''m happy to help.

> If I use BLOB, I have to make a lot of change to my code. Therefore, I have
> to persist it as String. I used base64 to encode and decode the byte[] into
> String. Because I resize the images to small ones. I use a VARCHAR length
> about 10k~20k to persist the String.

Thats fine, if you don't want to do a hugh code change then keep it the same

> "How often do you need to load all 300 images?  If it is forum style I
> would imangine a limited number of posting per page say max 20.  So
> the would be a maximum of 20 images per page load."
> If this is true, which method is the best among the above three?

Which method is 'best' depends on what you want. For fast access and
low memory - persist to hard drive

> "If you must use the least amount of memory as possible, persist the
> images to the hard drive and store the file reference to the url in
> the database.  "
> If I want to persist images to the hard drive of server. Shall I persist the
> data inside WAR or outside? Because user can change their portrait, does it
> mean it must be persisted outside WAR?

No just make a base dir in your app called 'userAvatar' or something
similar.  Then persist the image as user_.gif ( = the user
id).  When they chage their image override the file.

Also as stated by Pawel, make sure you have a performance problem
before you try to solve a performance problem.

> --
> View this message in context: 
> http://www.nabble.com/Performance-issue-with-large-data%28such-as-images%29-tp23945029p23948048.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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Interceptor - Conditional "Redirect" to alternate action

2009-06-08 Thread Mitchell, Steven
Oh, wow, that's incredibly simple.  I was making it too complicated in my mind, 
thinking I needed to tell the ActionInvocation class not to allow the original 
action to fire. 

I see now that the answer was right there in the API "[Interceptor.intercept()] 
- Allows the Interceptor to... short-circuit the processing and just return a 
String return code."

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Monday, June 08, 2009 9:14 AM
To: Struts Users Mailing List
Subject: Re: Interceptor - Conditional "Redirect" to alternate action

Could you use a global-result?

http://struts.apache.org/2.x/docs/result-configuration.html#ResultConfiguration-GlobalResults

I would just think up a unique name for the set of conditions that
should cause the redirect. Then, configure that string as a
global-result and write your interceptor to do the check and return
the string if the conditions are met and action.invoke otherwise.

-Wes

On Mon, Jun 8, 2009 at 10:09 AM, Mitchell,
Steven wrote:
> I need to put an interceptor after the cookie interceptor that will send
> the user to a preference page if a preference cookie is missing rather
> than let the desired action fire--like a guard condition. If I was using
> a Filter I would just do a redirect.
>
> Eventually I will also add a Flash shared object as a back-up to the
> cookie, so I'll need to put a Flash shared object interceptor in the
> stack too. The "redirector" interceptor would check the cookie and flash
> token values put set by the previous interceptors in the stack. If both
> are missing, then a different action needs to fire.
>
> Where can I find an example of an interceptor that conditionally
> "redirects" the user to an alternate action? I'm having trouble
> picturing how the plumbing would work and I think an example of this
> kind would be a big help.
>
> Steve Mitchell
> http://www.ByteworksInc.com
>
>
> --
> NOTICE:  This electronic mail message and any attached files are 
> confidential.  The information is exclusively for the use of the individual 
> or entity intended as the recipient.  If you are not the intended recipient, 
> any use, copying, printing, reviewing, retention, disclosure, distribution or 
> forwarding of the message or any attached file is not authorized and is 
> strictly prohibited.  If you have received this electronic mail message in 
> error, please advise the sender by reply electronic mail immediately and 
> permanently delete the original transmission, any attachments and any copies 
> of this message from your computer system. Thank you.
>
> ==
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



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



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



Interceptor - Conditional "Redirect" to alternate action

2009-06-08 Thread Mitchell, Steven
I need to put an interceptor after the cookie interceptor that will send
the user to a preference page if a preference cookie is missing rather
than let the desired action fire--like a guard condition. If I was using
a Filter I would just do a redirect. 

Eventually I will also add a Flash shared object as a back-up to the
cookie, so I'll need to put a Flash shared object interceptor in the
stack too. The "redirector" interceptor would check the cookie and flash
token values put set by the previous interceptors in the stack. If both
are missing, then a different action needs to fire.

Where can I find an example of an interceptor that conditionally
"redirects" the user to an alternate action? I'm having trouble
picturing how the plumbing would work and I think an example of this
kind would be a big help.

Steve Mitchell
http://www.ByteworksInc.com


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: (PROBLEM SOLVED) WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

2009-06-05 Thread Mitchell, Steven
Changing my mapping to *.action broke my
submit buttons. I had to add ".action" to my form action parameter
(action="myAction.action"). Is there some other setting to accomplish
the same thing?

-Original Message-
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Thursday, June 04, 2009 7:15 PM
To: Struts Users Mailing List
Subject: Re: (PROBLEM SOLVED) WAS 6.1: There is no Action mapped for
namespace / and action name j_security_check


Finally, the problem with form based authentication got resovled.
However; here is a summary of what happens that we get the error:

There is no Action mapped for namespace / and actionName
j_security_check

With form-based authentication, Websphere authenticates a user by using
URI //j_security_check.

Due to the fact that in struts 2.1 default action extension list
(struts.action.extension) has changed from just 'action' to 'action'
plus " , j_security_check is mistaken as an struts action.

Line:

config =
configuration.getRuntimeConfiguration().getActionConfig(namespace,
actionName);

in class com.opensymphony.xwork2.DefaultActionProxy located in method
prepare() returns null for actionName j_security_check" and consquently
"no mapping error" is displayed.

Solution:

as described in migration guide in the following link [which makes it
clear why everything in struts 2.0 works but not struts 2.1]:

http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-stru
ts-20x-to-21x.html

Add the following to your struts.xml



and then in your web.xml, change:


struts2
/*
  

TO 


struts2
*.action
   

The form based authentication works just like basic authentication. You
still need to have the following properties set:

com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror = true
com.ibm.ws.webcontainer.invokefilterscompatibility = true




  __
Reclaim your name @ymail.com or @rocketmail.com. Get your new email
address now! Go to http://ca.promos.yahoo.com/jacko/

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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-04 Thread Mitchell, Steven
UDPATE: WebSphere 6.1.0.23 did indeed fix our basic auth issue with
Struts 2.1.6.  It now successfully challenges the user if the try to
access a protected Struts action.

It did not fix the welcome file issue (using
index.html).  I think I will retest Wes's
suggestion to use index.action with a corresponding zero byte file.

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Thursday, June 04, 2009 12:55 PM
To: Struts Users Mailing List
Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in
web.xml


This is weird, as basic authentication works for me and I have got no
problem with it.

Anyways,Earlier today, I sent my Struts enterprise file to WAS Level 3
support for testing [form based authentication] and I will keep you
posted as soon as I hear sth.




  __
Ask a question on any topic and get answers from real people. Go to
Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-04 Thread Mitchell, Steven
Wes,

Go ahead, stir the pot!!! WAS 6.1 is a total cluster. I would love to drop kick 
it out of here.

By the way, my security problem really wasn't fixed.  Here is how I fixed.

I gave the team the green light to start testing on DEV and they all said they 
were getting 404 errors.  I showed them that I was testing the application from 
my box, but as soon as I closed my browser and tried again I too got the 404 
error.

The basic auth session must live on cached in the header. I got signed in 
because I created that test file under a directory mirroring my action 
namespace. Once I saw security was working I removed it, and some other test 
files, and redeployed the application.

In the end, the only way I could get Basic Auth to work running Struts 2.1.6 on 
WAS 6.1.0.19 was by putting a physical file in protected resource path: 
http://myServer/myContext/mySecurePath/index.html.  The file does a redirect to 
the desired protected struts 2 action.  When you hit that HTML file it causes 
WebSphere to do the Basic Auth challenge, after which the user gets redirected 
to Strtus 2 and life is good.

The WAS Admin is downloading 6.1.0.23.  Perhaps it will work better.

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Thursday, June 04, 2009 11:39 AM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

For the record, we have requested licenses for WebSphere because there
have been more than a few problems. I know Martin Cooper worked hard
to get us access to different versions of WebSphere in a way that kept
apache, us developers and struts safe while keeping IBM happy. I don't
think we were ever told "no," but the process has been very slow.

//not really trying to stir the pot (well, maybe a little)

-Wes

On Thu, Jun 4, 2009 at 12:11 PM, Mitchell, Steven
 wrote:
> Half of this problem has been solved--the important half.  During testing I 
> disabled security to verify that all of the Struts2 mappings worked, which 
> they did.  When my war was deployed to WebSphere by our auto-deploy script it 
> caused the LDAP role mappings to be dropped, which is the reason why security 
> did not once I re-enabled it.
>
> The problem with the welcome file persists.  As a test, I commented out the 
> Struts 2 filers.  I created a directory matching a secured Struts 2 
> namespace, and added a HTML file matching the welcome-file in the web.xml 
> file.  When I hit the base URL of the protected Strtus2 namespace, 
> http://myServer/myContext/mySecuredNameSpace/, with the Struts 2 filter 
> disabled Basic auth was triggered and WebSphere successfully returned the 
> index.html file in the root of that directory.  When I re-enabled the Struts 
> 2 filters the welcome-file quit working again.
>
> I would still like to understand why the welcome-file doesn't work on 
> WebSphere 6.1 with Struts 2, but it is not a show stopper.  We will simply 
> provide the users a deep link directly to the desired, secured action.
>
> Steve Mitchell
> http://www.ByteworksInc.com
>
> -Original Message-
> From: Mitchell, Steven
> Sent: Wednesday, June 03, 2009 4:48 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml
>
> Wes,
>
> That was an interesting exercise.  I changed my welcome-file to be 
> "index.action", added the zero-byte file "/webapp/index.action", and defined 
> the following action:
>
> 
>    /index.html
> 
>
> This worked the same on Tomcat 5.5 as it did when my welcome-file was just 
> "index.html."  Unfortunately, on WebSphere I still got the message: "Error 
> 404: There is no Action mapped for namespace / and action name index ." Of 
> course, if I type http://myserver/mycontext/index.action in the browser that 
> works fine.  Something is seriously hosed on WAS 6.1.
>
> I've asked the WAS Admin to bump us up to 6.1.0.23 and I'll continue testing 
> tomorrow.
>
> Thank you for your suggestion.
>
> Steve Mitchell
> http://www.ByteworksInc.com
>
> -Original Message-
> From: Mitchell, Steven [mailto:steven.mitch...@umb.com]
> Sent: Wednesday, June 03, 2009 4:18 PM
> To: Struts Users Mailing List
> Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml
>
> Wes,
>
> Boy do I wish the client would just use Tomcat! I'll try going down the 
> action route.  I'm actually using index.html now, which is a real file that I 
> can access if I type the whole URL: http://myserver/mycontext/index.html.  If 
> I understand what you are asking me to try, I will create a zero byte 
> /webapp/index.action, change my Web.xml from:

RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-04 Thread Mitchell, Steven
Half of this problem has been solved--the important half.  During testing I 
disabled security to verify that all of the Struts2 mappings worked, which they 
did.  When my war was deployed to WebSphere by our auto-deploy script it caused 
the LDAP role mappings to be dropped, which is the reason why security did not 
once I re-enabled it.

The problem with the welcome file persists.  As a test, I commented out the 
Struts 2 filers.  I created a directory matching a secured Struts 2 namespace, 
and added a HTML file matching the welcome-file in the web.xml file.  When I 
hit the base URL of the protected Strtus2 namespace, 
http://myServer/myContext/mySecuredNameSpace/, with the Struts 2 filter 
disabled Basic auth was triggered and WebSphere successfully returned the 
index.html file in the root of that directory.  When I re-enabled the Struts 2 
filters the welcome-file quit working again.

I would still like to understand why the welcome-file doesn't work on WebSphere 
6.1 with Struts 2, but it is not a show stopper.  We will simply provide the 
users a deep link directly to the desired, secured action.

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Mitchell, Steven 
Sent: Wednesday, June 03, 2009 4:48 PM
To: 'Struts Users Mailing List'
Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

Wes,

That was an interesting exercise.  I changed my welcome-file to be 
"index.action", added the zero-byte file "/webapp/index.action", and defined 
the following action:


/index.html


This worked the same on Tomcat 5.5 as it did when my welcome-file was just 
"index.html."  Unfortunately, on WebSphere I still got the message: "Error 404: 
There is no Action mapped for namespace / and action name index ." Of course, 
if I type http://myserver/mycontext/index.action in the browser that works 
fine.  Something is seriously hosed on WAS 6.1.

I've asked the WAS Admin to bump us up to 6.1.0.23 and I'll continue testing 
tomorrow.

Thank you for your suggestion.

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Mitchell, Steven [mailto:steven.mitch...@umb.com] 
Sent: Wednesday, June 03, 2009 4:18 PM
To: Struts Users Mailing List
Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

Wes,

Boy do I wish the client would just use Tomcat! I'll try going down the action 
route.  I'm actually using index.html now, which is a real file that I can 
access if I type the whole URL: http://myserver/mycontext/index.html.  If I 
understand what you are asking me to try, I will create a zero byte 
/webapp/index.action, change my Web.xml from:


index.html


to:


index.action


and add an action named "index".  Is that correct?  Actually, my index.html 
redirects to /mynamespace/myaction.action.  If I just used that I would need to 
create a directory named /mynamespace with a zero byte file called 
myaction.action.  Is that correct?

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Wednesday, June 03, 2009 4:00 PM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

On Wed, Jun 3, 2009 at 4:54 PM, Mitchell, Steven
 wrote:
[...]
>
>     Error 404: SRVE0190E: File not found: /secure/MySecureAction.action
[...]

I don't know about all of the problems, but one thing that might help
you understand this a little bit... This 404 might not be WAS' fault.
In the Spec (can't remember if it was 2.3 / 2.4) it was specified that
a file had to exist on the file system for it to be usable as a
welcome-file. This is sort of a pain for Struts2. One quick hack that
worked in Tomcat is to just create a zero-byte file called
index.action. I can't guarantee that WAS will be happy with that, but
I have used that before.

-Wes


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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete t

RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-03 Thread Mitchell, Steven
Wes,

That was an interesting exercise.  I changed my welcome-file to be 
"index.action", added the zero-byte file "/webapp/index.action", and defined 
the following action:


/index.html


This worked the same on Tomcat 5.5 as it did when my welcome-file was just 
"index.html."  Unfortunately, on WebSphere I still got the message: "Error 404: 
There is no Action mapped for namespace / and action name index ." Of course, 
if I type http://myserver/mycontext/index.action in the browser that works 
fine.  Something is seriously hosed on WAS 6.1.

I've asked the WAS Admin to bump us up to 6.1.0.23 and I'll continue testing 
tomorrow.

Thank you for your suggestion.

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Mitchell, Steven [mailto:steven.mitch...@umb.com] 
Sent: Wednesday, June 03, 2009 4:18 PM
To: Struts Users Mailing List
Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

Wes,

Boy do I wish the client would just use Tomcat! I'll try going down the action 
route.  I'm actually using index.html now, which is a real file that I can 
access if I type the whole URL: http://myserver/mycontext/index.html.  If I 
understand what you are asking me to try, I will create a zero byte 
/webapp/index.action, change my Web.xml from:


index.html


to:


index.action


and add an action named "index".  Is that correct?  Actually, my index.html 
redirects to /mynamespace/myaction.action.  If I just used that I would need to 
create a directory named /mynamespace with a zero byte file called 
myaction.action.  Is that correct?

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Wednesday, June 03, 2009 4:00 PM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

On Wed, Jun 3, 2009 at 4:54 PM, Mitchell, Steven
 wrote:
[...]
>
>     Error 404: SRVE0190E: File not found: /secure/MySecureAction.action
[...]

I don't know about all of the problems, but one thing that might help
you understand this a little bit... This 404 might not be WAS' fault.
In the Spec (can't remember if it was 2.3 / 2.4) it was specified that
a file had to exist on the file system for it to be usable as a
welcome-file. This is sort of a pain for Struts2. One quick hack that
worked in Tomcat is to just create a zero-byte file called
index.action. I can't guarantee that WAS will be happy with that, but
I have used that before.

-Wes


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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


-
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: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-03 Thread Mitchell, Steven
Wes,

Boy do I wish the client would just use Tomcat! I'll try going down the action 
route.  I'm actually using index.html now, which is a real file that I can 
access if I type the whole URL: http://myserver/mycontext/index.html.  If I 
understand what you are asking me to try, I will create a zero byte 
/webapp/index.action, change my Web.xml from:


index.html


to:


index.action


and add an action named "index".  Is that correct?  Actually, my index.html 
redirects to /mynamespace/myaction.action.  If I just used that I would need to 
create a directory named /mynamespace with a zero byte file called 
myaction.action.  Is that correct?

Steve Mitchell
http://www.ByteworksInc.com

-Original Message-
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Wednesday, June 03, 2009 4:00 PM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

On Wed, Jun 3, 2009 at 4:54 PM, Mitchell, Steven
 wrote:
[...]
>
>     Error 404: SRVE0190E: File not found: /secure/MySecureAction.action
[...]

I don't know about all of the problems, but one thing that might help
you understand this a little bit... This 404 might not be WAS' fault.
In the Spec (can't remember if it was 2.3 / 2.4) it was specified that
a file had to exist on the file system for it to be usable as a
welcome-file. This is sort of a pain for Struts2. One quick hack that
worked in Tomcat is to just create a zero-byte file called
index.action. I can't guarantee that WAS will be happy with that, but
I have used that before.

-Wes


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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-03 Thread Mitchell, Steven
I'm down to two issues:

BROKEN WELCOME-FILE

WebSphere 6.1.0.19 fails to return the welcome-file from the web.xml
when presented with the root URL http://myServer/myContext/ of the
project.  Instead, the request falls through to the Struts2 filter which
returns a 404:

 Error 404: There is no Action mapped for namespace / and action
name .

BASIC AUTH IS BROKEN

All application actions work without security, but after enabling basic
auth only the unsecured links work.  WebSphere 6.1.0.19 will correctly
intercept requests for secured resources, but instead of triggering
basic auth, it returns a WebSphere-specific 404 error message, below.
The application works flawlessly on Tomcat 5.5 with form-based or basic
authentication.

 Error 404: SRVE0190E: File not found: /secure/MySecureAction.action

CUSTOM PROPERTIES

The following custom properties are set:

 com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror = true
 com.ibm.ws.webcontainer.invokefilterscompatibility = true

Does anybody have any ideas how to fix these problems?

There are the security settings in the Web.xml:


General User Security Constraint.

My Security Constraint.

My Secure Stuff
/secure/*
GET
PUT
HEAD
TRACE
POST
DELETE
OPTIONS   


Trusted users.
 MySecurityRole 



BASIC


My Security Role
MySecurityRole


-Original Message-
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Wednesday, June 03, 2009 10:47 AM
To: Struts Users Mailing List
Subject: RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in
web.xml


> Can you explain why index.html would work and index.jsp would not? I
got
> index.html to work

Quite frankly, I do not know. I never had this problem when I was using
struts 1. I could do something like this in my welcome file [which would
invoke an action instead]:

index.do

and entering http://

RE: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-03 Thread Mitchell, Steven
Struts Two,

Two steps forward, three steps back.  Switching from index.jsp to
index.html required some JavaScript to replace <%=
request.getContextPath %>, and it behaved differently on WebSphere than
Tomcat so I had to check whether the page name was returned.  Below is
the JavaScript I came up with.

Can you explain why index.html would work and index.jsp would not? I got
index.html to work briefly yesterday, but
as I added security and other struts includes it quit working.  I've
stripped the configuration files back to where I thought they were when
they worked, but the welcome-file and all namespace actions are broken
again.  Perhaps if I knew the logic behind the switch from index.jsp to
index.html I would gain some insight.

The only change since I had it working that I am aware of is that
com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror is set to
true, but since I've temporarily yanked security from my web.xml I
wouldn't think that would matter.

var contextpath = window.location.pathname;
var fileIndex = contextpath.indexOf( "index.html" );
if ( fileIndex > 0 ) 
{
contextpath = contextpath.substring( 0 , fileIndex );
}
window.location = contextpath + "myAction.action";

-Original Message-
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Tuesday, June 02, 2009 3:35 PM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in
web.xml



> Typing http://servername/context/ results in "Error 404: There
> is no Action mapped for namespace / and action name ." 

To fix this issue, modify your welcome part of web.xml,


 index.html   


create an index.html with the following content:








Loading ...



Then typing http://servername/context/ should work.



  __
Be smarter than spam. See how smart SpamGuard is at giving junk email
the boot with the All-new Yahoo! Mail.  Click on Options in Mail and
switch to New Mail today or register for free at http://mail.yahoo.ca

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


--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in web.xml

2009-06-02 Thread Mitchell, Steven
Having learned that form-based authentication currently does not
currently work with Struts 2.1.x on WAS 6.1 or WAS 7 I stepped back to
see what does work. I gutted my web.xml and struts.xml and set about
turning things on one at a time.  This is what I found:

1. Basic hello world app with only a welcome-file worked.
2. Adding Spring 2 listener and Sitemesh filter worked.
3. Adding Struts2 dispatcher breaks the welcome-file!?? 

With Struts 2 enabled, I observed the following:

Typing http://servername/context/ results in "Error 404: There
is no Action mapped for namespace / and action name ." 
Typing http://servername/context/index.jsp results is display of
the JSP fully decorated by Sitemesh (that should have been displayed
above).
Typing http://servername/context/hello (or hello.action)
displays the hello world JSP fully decorated by Sitemesh.
Typing http://servername/context/helloWorld (or
helloWorld.action) displays the hello world JSP fully decorated by
Sitemesh.

We have com.ibm.ws.webcontainer.invokefilterscompatibility = true.
Attached are my gutted web.xml and struts.xml contents (slightly
obfuscated). 

Why does adding the Struts2 filters break the welcome-file from web.xml?



http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">
My GUTTED Application  


javax.servlet.jsp.jstl.fmt.localizationContext
ApplicationResources


struts2-prepare

 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
   

sitemesh
 
com.opensymphony.module.sitemesh.filter.PageFilter


struts2-execute

 
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter


struts2-prepare
/*


sitemesh
/*


struts2-execute
/*
  

index.jsp



org.springframework.web.context.ContextLoaderListener




http://struts.apache.org/dtds/struts-2.1.dtd";>
 
   

/helloworld.jsp

  
/helloworld.jsp




NOTE: I tested with and without a package namespace of "/". 


Steven C. Mitchell
Byteworks, Inc.  



--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

2009-06-02 Thread Mitchell, Steven
I will look at that.  Meanwhile, I found that WAS logged an error (this
was after the WAS admin tried changing the filter from /* to /[my
context]/*

--Start of DE processing-- = [5/29/09 13:50:09:369 CDT] , key =
javax.servlet.ServletException
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest() 309
Exception = javax.servlet.ServletException
Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
probeid = 309
Stack Dump = javax.servlet.ServletException: Filter [struts2]: could not
be initialized
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstance
Wrapper.java:156)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFil
terManager.java:471)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilt
erManager.java:385)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrap
per(WebAppFilterManager.java:244)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebApp
FilterManager.java:302)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:792)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:679)
at
com.ibm.ws.webcontainer.servlet.FileServletWrapper.handleRequest(FileSer
vletWrapper.java:416)
at
com.ibm.ws.wswebcontainer.servlet.StaticFileServletWrapper.handleRequest
(StaticFileServletWrapper.java:93)
at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques
t(DefaultExtensionProcessor.java:714)
at
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ
est(DefaultExtensionProcessor.java:113)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815
)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1
461)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1
18)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(HttpInboundLink.java:458)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(HttpInboundLink.java:387)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi
nk.java:267)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr
iminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(Ne
wConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(Ai
oReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.
java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFu
ture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java
:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

Dump of callerThis = 
null

Exception = javax.servlet.ServletException
Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
probeid = 309
Dump of callerThis = 
null

-Original Message-
From: Ron Chan [mailto:rc...@i-tao.com] 
Sent: Tuesday, June 02, 2009 10:26 AM
To: user@struts.apache.org
Subject: Re: WAS 6.1: There is no Action mapped for namespace / and
action name j_security_check


Steven

Not familiar with your setup and if it works in tomcat and not WAS, even
stranger.  But for what it's worth here is my hack, I made a copy of
StrutsPrepareAndExecuteFilter and in the doFilter where it said

ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request,
response);

I added
ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping != null) {
if ("".equals(mapping.getName())) {
mapping = null;
}
}
if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request,
response);

not ideal, but fixed my prob

HTH
Ron

-- 
View this message in context:
http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p2383486
4.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


---

WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

2009-06-02 Thread Mitchell, Steven
I'm still trying to get Struts 2.1.6 deployed on WAS 6.1.  I'm fighting
a couple of related issues.  Index.jsp forwards to
/MyContext/myNamespace/myAction.action, but gets this error:

There is no Action mapped for namespace / and action name . -
[unknown location]

If I type http://myServer/myContext/myNamespace/myAction.action in the
browser I get to my log-in page decorated by SiteMesh.  If I submit the
login page I get this error:

There is no Action mapped for namespace / and action name
j_security_check

The site works fine on Tomcat 5.5.

WebSphere 6.1 is fully patched, is using reverse class loading, and we
have set the following property:

com.ibm.ws.webcontainer.invokeFiltersCompatibility = true

Here are the filters that we are using:


struts2-prepare

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter



sitemesh

com.opensymphony.module.sitemesh.filter.PageFilter



struts2-execute

org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter



The security looks like this:



My Secure Stuff
/MyNamespace/*


MyRole



FORM

/security/login.jsp
/security/login_error.jsp



My Role
MyRole


Thoughts?

Steve Mitchell
http://www.ByteworksInc.com

--
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==


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



RE: Struts 2 dispatcher does not see namespace and action in URL

2009-05-26 Thread Mitchell, Steven
To answer your question, the application is using form based authentication. 


FORM
Security Profile

/[my path]/[my login].jsp
/[my path]/[my login error].jsp



-Original Message-
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Tuesday, May 26, 2009 1:48 PM
To: Struts Users Mailing List
Subject: RE: Struts 2 dispatcher does not see namespace and action in URL


Do you have Basic or Form based authentication enabled in your web.xml?

--- On Tue, 5/26/09, Mitchell, Steven  wrote:

> From: Mitchell, Steven 
> Subject: RE: Struts 2 dispatcher does not see namespace and action in URL
> To: "Struts Users Mailing List" 
> Received: Tuesday, May 26, 2009, 3:33 PM
> I found a post about setting
> com.ibm.ws.webcontainer.invokefilterscompatibility = true,
> but it made
> no difference.  The namespace and action name are
> still getting dropped
> before reaching Struts.  
> 
> Since it works find on Tomcat 5.5, I suspect
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper,
> com.ibm.ws.webcontainer.filter.WebAppFilterChain, or
> com.ibm.ws.wswebcontainer.filter.WebAppFilterManager simply
> because they
> are the previous three classes in the stack trace. 
> 
> I'll keep Googling.  Any other ideas?
> 
> -Original Message-
> From: Mitchell, Steven [mailto:steven.mitch...@umb.com]
> 
> Sent: Tuesday, May 26, 2009 8:23 AM
> To: user@struts.apache.org
> Subject: Struts 2 dispatcher does not see namespace and
> action in URL
> 
> I have a Struts 2 application that runs fine under Tomcat
> 5.5 that will
> not run on a fully patched version of WebSphere 6.1. 
> The application
> index.jsp page redirects to a mapped namespace and action,
> yet the
> Struts 2 dispatcher does not see the namespace or
> action.  It issues the
> message "There is no Action mapped for namespace / and
> action name ."
> Note that the namespace and action name are missing.
> 
> I have also tried manually typing a full URL containing a
> namespace and
> action, yet I get the same error message missing the
> namespace and
> action name.  This has never happened on Tomcat 5.5
> where the
> application functions normally.
> 
> Has anybody run into this issue deploying an application on
> WebSphere?
> It happens with Struts 2.1.2, 2.1.3 snapshot, and
> 2.1.6.  I'm out of
> ideas.
> 
> [5/21/09 16:52:06:743 CDT] 002c XmlConfigurat I
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger
> info Parsing
> configuration file [struts.xml]
> [5/21/09 16:52:07:101 CDT] 002c StrutsSpringO I
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger
> info
> Initializing Struts-Spring integration...
> [5/21/09 16:52:07:113 CDT] 002c SpringObjectF I
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger
> info Setting
> autowire strategy to name
> [5/21/09 16:52:07:111 CDT] 002c StrutsSpringO I
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger
> info ...
> initialized Struts-Spring integration successfully
> [5/21/09 16:52:08:817 CDT] 002c Dispatcher   
> W
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger
> warn Could
> not find action or result
>                
>              
>    There is no Action mapped for namespace
> / and action name . - [unknown location]
>         at
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.ja
> va:177)
>         at
> org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java
> :61)
>         at
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Strut
> sActionProxyFactory.java:39)
>         at
> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(Defa
> ultActionProxyFactory.java:47)
>         at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
> 57)
>         at
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:395)
>         at
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst
> anceWrapper.java:190)
>         at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh
> ain.java:130)
>         at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterC
> hain.java:87)
>         at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
> Manager.java:832)
>         at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
> ilterManager.java:742)
>         at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
> ilterManager.java:695)
>    

RE: Struts 2 dispatcher does not see namespace and action in URL

2009-05-26 Thread Mitchell, Steven
I found a post about setting
com.ibm.ws.webcontainer.invokefilterscompatibility = true, but it made
no difference.  The namespace and action name are still getting dropped
before reaching Struts.  

Since it works find on Tomcat 5.5, I suspect
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper,
com.ibm.ws.webcontainer.filter.WebAppFilterChain, or
com.ibm.ws.wswebcontainer.filter.WebAppFilterManager simply because they
are the previous three classes in the stack trace. 

I'll keep Googling.  Any other ideas?

-Original Message-
From: Mitchell, Steven [mailto:steven.mitch...@umb.com] 
Sent: Tuesday, May 26, 2009 8:23 AM
To: user@struts.apache.org
Subject: Struts 2 dispatcher does not see namespace and action in URL

I have a Struts 2 application that runs fine under Tomcat 5.5 that will
not run on a fully patched version of WebSphere 6.1.  The application
index.jsp page redirects to a mapped namespace and action, yet the
Struts 2 dispatcher does not see the namespace or action.  It issues the
message "There is no Action mapped for namespace / and action name ."
Note that the namespace and action name are missing.

I have also tried manually typing a full URL containing a namespace and
action, yet I get the same error message missing the namespace and
action name.  This has never happened on Tomcat 5.5 where the
application functions normally.

Has anybody run into this issue deploying an application on WebSphere?
It happens with Struts 2.1.2, 2.1.3 snapshot, and 2.1.6.  I'm out of
ideas.

[5/21/09 16:52:06:743 CDT] 002c XmlConfigurat I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Parsing
configuration file [struts.xml]
[5/21/09 16:52:07:101 CDT] 002c StrutsSpringO I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
Initializing Struts-Spring integration...
[5/21/09 16:52:07:113 CDT] 002c SpringObjectF I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Setting
autowire strategy to name
[5/21/09 16:52:07:111 CDT] 002c StrutsSpringO I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info ...
initialized Struts-Spring integration successfully
[5/21/09 16:52:08:817 CDT] 002c DispatcherW
com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could
not find action or result
 There is no Action mapped for namespace
/ and action name . - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.ja
va:177)
at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java
:61)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Strut
sActionProxyFactory.java:39)
at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(Defa
ultActionProxyFactory.java:47)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
57)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst
anceWrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh
ain.java:130)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterC
hain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:832)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
ilterManager.java:742)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
ilterManager.java:695)
at
com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAp
pFilterManager.java:101)
at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilter
s(DefaultExtensionProcessor.java:818)
at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques
t(DefaultExtensionProcessor.java:557)
at
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ
est(DefaultExtensionProcessor.java:113)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815
)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1
461)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1
18)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(HttpInboundLink.java:458)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(HttpInboundLink.java:387)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi
nk.java:267)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr
iminators(NewConnectionInitialR

Struts 2 dispatcher does not see namespace and action in URL

2009-05-26 Thread Mitchell, Steven
I have a Struts 2 application that runs fine under Tomcat 5.5 that will
not run on a fully patched version of WebSphere 6.1.  The application
index.jsp page redirects to a mapped namespace and action, yet the
Struts 2 dispatcher does not see the namespace or action.  It issues the
message "There is no Action mapped for namespace / and action name ."
Note that the namespace and action name are missing.

I have also tried manually typing a full URL containing a namespace and
action, yet I get the same error message missing the namespace and
action name.  This has never happened on Tomcat 5.5 where the
application functions normally.

Has anybody run into this issue deploying an application on WebSphere?
It happens with Struts 2.1.2, 2.1.3 snapshot, and 2.1.6.  I'm out of
ideas.

[5/21/09 16:52:06:743 CDT] 002c XmlConfigurat I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Parsing
configuration file [struts.xml]
[5/21/09 16:52:07:101 CDT] 002c StrutsSpringO I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
Initializing Struts-Spring integration...
[5/21/09 16:52:07:113 CDT] 002c SpringObjectF I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Setting
autowire strategy to name
[5/21/09 16:52:07:111 CDT] 002c StrutsSpringO I
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info ...
initialized Struts-Spring integration successfully
[5/21/09 16:52:08:817 CDT] 002c DispatcherW
com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could
not find action or result
 There is no Action mapped for namespace
/ and action name . - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.ja
va:177)
at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java
:61)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Strut
sActionProxyFactory.java:39)
at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(Defa
ultActionProxyFactory.java:47)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
57)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst
anceWrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh
ain.java:130)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterC
hain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:832)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
ilterManager.java:742)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF
ilterManager.java:695)
at
com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAp
pFilterManager.java:101)
at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilter
s(DefaultExtensionProcessor.java:818)
at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques
t(DefaultExtensionProcessor.java:557)
at
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ
est(DefaultExtensionProcessor.java:113)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815
)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1
461)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1
18)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(HttpInboundLink.java:458)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(HttpInboundLink.java:387)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi
nk.java:267)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr
iminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(Ne
wConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(Ai
oReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.
java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFu
ture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java
:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:8

RE: Testing Struts With JUnit

2005-08-19 Thread Mitchell, Steven C
Luiz,

Are you aware that there is an extension of Junit made for testing Struts?

http://strutstestcase.sourceforge.net/

-Original Message-
From: Luiz Godoy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 18, 2005 3:22 PM
To: Struts Users Mailing List
Subject: Testing Struts With JUnit




 

I´m trying to test the action below :

public class FamiliaDNCAction extends BasicAction {

public ActionForward unspecified(ActionMapping actionMapping, ActionForm 
actionForm, HttpServletRequest request, HttpServletResponse response) throws 
BusinessException {
  Set msgs = new HashSet();  
  return loadPage(actionMapping,actionForm,request,response);
 }

public ActionForward loadPage(ActionMapping actionMapping, ActionForm 
actionForm, HttpServletRequest request, HttpServletResponse response) throws 
BusinessException {
  HttpSession session=request.getSession();
  CadastroFamiliaDNC cad = new CadastroFamiliaDNC();
 FamiliaDNCForm form = (FamiliaDNCForm) actionForm;
  List dados = cad.findByCodigoDependencia(form.getCodDependencia().intValue());
  session.setAttribute("dadosdnc",dados); 
  return actionMapping.findForward("inicial");
 }

}

The parameters for the action are 

FamiliaDNC.do -- calls the class
ev --> the parameter for the method, when not set calls "unspecified" method

public class TestFamiliaDNCAction extends MockStrutsTestCase{  FamiliaDNCAction 
fdnca;
  public TestFamiliaDNCAction(String nomeDoTeste) {
super(nomeDoTeste);
 }
  
  public void setUp() throws Exception {
super.setUp();
fdnca = new FamiliaDNCAction();
}

  public void testLoadPage() {
  
   addRequestParameter("codDependencia","1");
   addRequestParameter("codTipoFamiliaInsumo","0");
   addRequestParameter("ev","unspecified");
setRequestPathInfo("/corporativo/cadastro/cadFamiliaDNC");
actionPerform();
verifyForward("inicial");
 verifyForwardPath("/corporativo/cadastro/corp_cad_familia_dnc.jsp");
verifyNoActionErrors();
}

 I´m getting nullPointerException, when i try to test it. I´m not sure 
witch parameters i add to the request for example in the action form i have:


  
  
  
  .
/form>  

My question is, witch parameters do i put in the addRequestParameter("?","?"); ?

any clue ?

Thanks in advance 

regards..



Luiz Octavio Godoy 

Desenvolvimento de Sistemas

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Question on log on with SecurityFilter and JDBCRealm

2005-08-19 Thread Mitchell, Steven C
C.F.,

Getting Filters to run is a "set and forget" sort of thing.  Once you
define them in your web.xml file they will run automatically. The specs
can do a better job explaining Filters than I can.  Filters get invoked
for ever request matching a specified URL pattern.  You can also chain
multiple filters together.  You'll notice that only HttpServletRequests
are processed by the code I sent yesterday.  I have not observed any
noticeable performance difference with the filter running.

A Filter works just like a Servlet when it comes to URL mapping.  If
only part of your site is secured the Filter need only be invoked for
calls to that URL pattern.  In the example below I show a URL pattern of
/secured/* to invoke the Filter only if the resource URL contains
"/secured/".


contextInitializer
contextInitializer

 
com.umb.optout.view.ContextInitializerFilter


contextInitializer
/secured/*
 

Steve

-Original Message-
From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 18, 2005 5:19 PM
To: Struts Users Mailing List; Mitchell, Steven C
Subject: Re: Question on log on with SecurityFilter and JDBCRealm


Steven,

Thanks!
Yeah, great idea. In fact I was reading about that on O'Reilly's Struts 
Cookbook.

I have one question to you though:

How is the filter executed? After the login? Or after every http request

to the server?
What does fire the filter up? Is it like an event for a GUI app? I would

like to understand this
concept better.

regards,

C.F.

Mitchell, Steven C wrote:

>Have you considered using a Filter to put the extra stuff in your 
>Session?  We use an initialization Filter that looks up a User record 
>based on the authenticated user id.  We then place that User object 
>both in the Session and a thread local variable so that it is available

>to all the layers of our framework.  Our DAO classes use the thread 
>local variable to set things like Last Updated By.  If you use the 
>thread local variable make sure the last thing the Filter does is to 
>set it to null so that the thread is not returned to the container's 
>thread pool with the User object.
>
>public void doFilter( final ServletRequest servletRequest, 
>final ServletResponse servletResponse, 
>final FilterChain filterChain )
>throws IOException, ServletException
>{
>if ( servletRequest instanceof HttpServletRequest )
>{
>final HttpServletRequest httpServletRequest = 
>(HttpServletRequest) servletRequest;
>final String remoteUser = 
>httpServletRequest.getRemoteUser();
>if ( DataHelper.empty( remoteUser ) || 
>"null".equalsIgnoreCase( remoteUser ) )
>{
>if ( log.isDebugEnabled() )
>{
>log.debug( "No User info Available" );
>} //end if
>
>ThreadContext.setUser( null );
>} //end if
>else
>{
>final HttpSession session = 
>httpServletRequest.getSession( true );
>User user = (User) session.getAttribute( 
>SESSION_TOKEN_SYSUSER );
>if ( user == null )
>{
>try
>{
>user = UserController.findUserByLoginId( 
>remoteUser );
>if ( log.isDebugEnabled() )
>{
>log.debug( "Initializing user " +
>user.getUserId() );
>} //end if
>} //end try
>catch ( final Exception e )
>{
>throw new ServletException( e );
>} //end catch
>
>session.setAttribute( SESSION_TOKEN_SYSUSER, user
);
>} //end if
>
>ThreadContext.setUser( user );
>} //end else
>} //end if
>
>filterChain.doFilter( servletRequest, servletResponse );
>ThreadContext.setUser( null ); //Clear the thread before 
>returning it to the server's thread pool
>}
>
>Steve Mitchell
>UMB Bank
>
>-Original Message-
>From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 17, 2005 12:50 PM
>To: Struts Users Mailing List
>Subject: Question on log on with SecurityFilter and JDBCRealm
>
>
>Hello all,
>
>I've managed to have successful authentication with securityFilter and
>JDBCRealm.
>
>I have a few questions that I was hoping you could clari

RE: Question on log on with SecurityFilter and JDBCRealm

2005-08-18 Thread Mitchell, Steven C
Have you considered using a Filter to put the extra stuff in your
Session?  We use an initialization Filter that looks up a User record
based on the authenticated user id.  We then place that User object both
in the Session and a thread local variable so that it is available to
all the layers of our framework.  Our DAO classes use the thread local
variable to set things like Last Updated By.  If you use the thread
local variable make sure the last thing the Filter does is to set it to
null so that the thread is not returned to the container's thread pool
with the User object.

public void doFilter( final ServletRequest servletRequest, 
final ServletResponse servletResponse, 
final FilterChain filterChain )
throws IOException, ServletException
{
if ( servletRequest instanceof HttpServletRequest )
{
final HttpServletRequest httpServletRequest = 
(HttpServletRequest) servletRequest;
final String remoteUser =
httpServletRequest.getRemoteUser();
if ( DataHelper.empty( remoteUser ) || 
"null".equalsIgnoreCase( remoteUser ) )
{
if ( log.isDebugEnabled() )
{
log.debug( "No User info Available" );
} //end if

ThreadContext.setUser( null );
} //end if
else
{
final HttpSession session =
httpServletRequest.getSession( true );
User user = (User) session.getAttribute(
SESSION_TOKEN_SYSUSER );
if ( user == null )
{
try
{
user = UserController.findUserByLoginId(
remoteUser );
if ( log.isDebugEnabled() )
{
log.debug( "Initializing user " +
user.getUserId() );
} //end if
} //end try
catch ( final Exception e )
{
throw new ServletException( e );
} //end catch

session.setAttribute( SESSION_TOKEN_SYSUSER, user );
} //end if

ThreadContext.setUser( user );
} //end else
} //end if

filterChain.doFilter( servletRequest, servletResponse );
ThreadContext.setUser( null ); //Clear the thread before
returning it to the server's thread pool
}

Steve Mitchell
UMB Bank

-Original Message-
From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 12:50 PM
To: Struts Users Mailing List
Subject: Question on log on with SecurityFilter and JDBCRealm


Hello all,

I've managed to have successful authentication with securityFilter and 
JDBCRealm.

I have a few questions that I was hoping you could clarify for me.

After the login is successful, is there any way to forward that to a 
success page/action
so that I can add extra stuff to the session context? This is my 
 session
in the securityfilter-config.xml file:

**
  **FORM**
  **
 **/login.jsp**
 **/error.jsp**
 **/index.html**
  **
   **


My second question is concernig accessing the username value from the 
session context.
How is that stored in the session? How can I access it?
My login.jsp form uses standard j_security_check for the action on the 
login form, j_username, j_password for the 2 inputs.

I would like, after the login is succesful to forward that to an action 
in order to access the database using the username as a key and return
an userID number that I also want to store in the session. How can I
accomplish this?

Thanks in advance,

C.F.

-
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]



Passing data between action forms

2005-07-08 Thread Mitchell, Steven C
I'm curious to hear what other people are doing regarding the passing of
data between actions.  Take for example an advanced search page with
validation, drop down lists, the works.  Upon successful validation the
user should flow to a search results page.  Assume the results page is
part of something bigger that may require additional server-side
processing.  
 
In the past I have put the search results list on the same action form
as the search criteria and just forwarded to a different JSP from the
same action.  There are times when I would prefer to forward to a
different action/form pair, especially if their is potential for
additional processing.  I suppose I could put the form in the session
and define a different action that uses the same form to achieve some
modularity, but I would prefer to be able to just hand-off the search
results to a separate action/form pair.  Is there an elegant way to do
that in Struts?  Am I just trying to make this overly complex?