Sam Chang

Greenhorn
+ Follow
since Mar 22, 2007
Merit badge: grant badges
For More
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 Sam Chang

Im using struts 2 and have all my actions mapped to the url pattern "/*" and using sitemesh and acegi-security.

The problem im having is that both sitemesh and acegi-security rely on the url to be specific whereas the way i have my struts actions mapped means they can have any prefix. eg. say i have the struts action: doSomethingSecure.action in /secure/. It would be linked normally by /secure/doSomethingSecure.action, but it also does the same thing as /doSomethingSecure.action (without the /secure/ prefix) which means sitemesh and acegi-security wont do their stuff on it?

My main concern is with acegi-not doing a security check, and whether there is someway to fix the actions url to have a specific url?

And in struts.xml i have
<package name="default" extends="struts-default">
Does anyone know what that line means? I wasnt able to find any documentation on it, so any help is appreciated.

cheers,
sam
16 years ago
Im using struts action 2 and was looking into implementing my own simple user management and authentcation but i figured it would be more efficient and secure to use existing ones.

are there any free, good and easy to use security frameworks people are using or know of?
Well in more detail of why I want the ServletContext is because I want to render some FreeMarker templates within the struts 2 action class (not as the result type). FreeMarker allows me to set the template loading with the three methods:
1. setDirectoryForTemplateLoading(File dir);
2. setClassForTemplateLoading(Class cl, String prefix);
3. setServletContextForTemplateLoading(Object servletContext, String path);
please see http://freemarker.sourceforge.net/docs/pgui_config_templateloading.html for my reasons to wanting to use method 3. But in short, method 1 is out of the question as its a fixed location and since i cant get a hold of ServletContext I'm forced to use method 2 which requires me to put the FreeMarker templates in the classpath specified. Its not a major obstacle but I would like to put the templates in a seperate directory and not in the classpath.

with regards to getting filterConfig, I have little idea on how to do that, and any help on that would be greatly appreciated also

cheers,
sam
17 years ago
I'm using struts 2 client side AJAX validation. I have it all setup like on http://struts.apache.org/2.0.6/docs/ajax-validation.html and it does validate properly, however it does not clear the existing error messages and simply adds the new error messages onblur, causing duplicate error messages to be displayed.

Have I mis-configured something? Has anybody else had this problem before?

cheers,
sam
17 years ago
I need the ServletContext from my struts 2 action class, but I cant find any way of getting it.

I couldn't find the getServlet() or getServletConfig() methods like in struts 1, and org.apache.struts2.ServletActionContext.getServletContext() returns me null.

Any help would be great!
sam
17 years ago