Wes Hughes

Ranch Hand
+ Follow
since Jul 29, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Wes Hughes

You're gonna need to explain it a little better or post some code cause from my understanding you have written a method which expects an Object as argument and you are passing in a String (which extends Object), therefore you shouldn't have any problem.
12 years ago

Originally posted by Jeanne Boyarsky:

A filter is definitely the way to go. It sounds like there are some pages that forward directly to JSPs, rather than the Struts action. If that is the case, you need to refactor the design a bit. You can still have the forward to a JSP by adding a level of indirection. Forward to an action path in the Struts config file. It doesn't have to be a full fledged action. Just having it in the struts config file will be enough to go through the ActionServlet. Then your filter will get called.



Bad terminology on my part, j_security_check is forwarding to the protected resource, in this case a Struts action. Problem was I was doing my work after chain.doFilter(), so it wasn't showing up in page I expected. Anyways, thanks for the help.
13 years ago
I'm stuck on the problem of wanting to perform a specific action (setting a session attribute for display in the UI) after a user has logged in (using JAAS/j_security_check). At first I thought I'd apply a filter to j_security_check. Not supported. Then I decided to just apply a filter to all *.do requests. This works fine except for certain login situations, where j_security_check just forwards to the requested page and my filter is never called. So currently, when the user logs in to certain pages, the first page view is missing the session attribute I want to display and it looks buggy.
13 years ago
Many thanks. Never had the opportunity to use that before.
14 years ago
I need to generate a signature for a jar file within my application (could be standalone/web app/etc). To do that I need to get the path to the jar file. I thought that something like getClass().getResource("struts.jar").getFile() would do it but it doesn't (i.e. this throws an NPE within a struts app). The above syntax only works when you specify that the folder containing the jar is on the classpath, not the jar itself.

How can I do this without including the folder containing the jar on the classpath?

Thanks.
14 years ago
Thanks for all the answers but I'm really looking for programmatic solutions along the line of the first two.
14 years ago
Is there any way to terminate a web application without calling System.exit(). Basically, if there are some invalid properties/etc during initialization of the web app, we would like to force the application to shut down or not run. Calling System.exit is obviously risky in a shared container.

Thx in advance.
14 years ago
Whenever the ant junit task is run I get a file named junit#########.properties where the ## represent a generated number. The header of the file is #Ant JUnitTask generated properties file and it contains all the system and user properties. Is there any way to:

a) prevent this file from being created or
b) force it to be output to a specific directory
14 years ago
Say I have a stateless session bean with a method that gets a connection from the data source, makes a database call and then for each record returned calls another method, possibly in another stateless session bean, which does its own database access. In this situation does each connection established correspond to a new physical connection to the database, or is the physical conncection somehow reused amonst these logical connections? This doesn't seem possible though as the first connection is not closed when the second is established.
Is it dependent on the transaction type of the method?

Basically, my concern is that if I have methods calling methods calling methods etc that it will use a lot of physical connections to the database.

Thanks.
We are using JAAS and a custom login module to authenticate users to our J2EE app. We are now required to share authentication with another J2EE app running on the same server (i.e. a user can go back and forth without having to re-authenticate). Is this even possible? We're running on Oracle 9iAS, which does support SSO but this not really the approach that we are looking for (but may have to consider).
Thanks.
14 years ago
Sorry if I wasn't clear enough. Basically I want the login in our application to be secure, other than that there are no requirements for https. I decided to use the struts ssl ext to declaratively specify that my login action be secure.
But now I'm having a heck of a time trying to get it to work with Oracle 9iAS. It keeps returning me empty responses when I try to request something, secure or not.
14 years ago
I'm using JAAS with form based authentication in our application. E.g. user requests a secured page, is forwarded to login page, authenticated through j_security_check, etc. I'd like to make the j_security_check action secure (https) but https isn't a requirement anywhere else in our application.
I'm not sure what the best way to do this is.
Thanks.
14 years ago
I've been doing some refactoring with my ApplicationResources.properties and every once in a while I get a page that shows a JspException when I've mistyped a property name or whatever. Is there anyway of catching the JspException at this compilcation point and displaying a different message?
Theoretically, this should never happen once we deploy, but it could if someone mucked around with the properties.
14 years ago
After a better second look, your code does just what I want. The only thing I changed was to use a StringBuffer to store the results.
14 years ago
Its close but I think its just flipping the sign, so I'm only getting values in the range 0x00 to 0x80 still. I'm currently using this but it isnt pretty:

[ August 29, 2003: Message edited by: Wes Hughes ]
[ August 29, 2003: Message edited by: Wes Hughes ]
14 years ago