Re: Localization in struts 2

2009-06-22 Thread Johnson nickel
I have specified in my header.jsp, lang.action?request_locale=en English | lang.action?request_locale=fr French | lang.action?request_locale=hi Hindi | In my Index.action file, public String execute() throws Exception{ System.out.println("Inside Index actio

Re: Struts2 and Security

2009-06-22 Thread aum strut
Dave Our requirement is to use good authentication framework for our application and as per the initial application draft we are not going to use spring in our application. as we have found that Spring Security is quite a matured framework so we are just investigating the option, if we can use it

RE: how to prevent users from directly accessing jsp files

2009-06-22 Thread Kishan G. Chellap Paandy
I tried something like below it worked All JSP direct access /jsp/* POST GET No Access restricted NO Access restricted Thank you. Regards, Kishan.G Team Leader. www.spansystems.com -Original Mes

Exceptions thrown by constructor different from those thown by execute() ?

2009-06-22 Thread Jan T. Kim
Dear All, I'm trying to use exceptions to make sure a user is logged in, using struts 2.1.6. My idea is * a subclass of ActionSupport that checks that a user is logged in, and throws a NotLoggedInException if that's not the case * all other action handlers are subclasses of that su

Re: Struts2 static content

2009-06-22 Thread Musachy Barroso
serving static content with struts 2 is probably not a good idea (performance and security wise) musachy On Mon, Jun 22, 2009 at 3:13 PM, rtd wrote: > > It took me some time to solve this, so I thought I'd share.  My immediate > need was to serve css, but static html, js, etc. could be done simil

Re: Struts2 static content

2009-06-22 Thread rtd
It took me some time to solve this, so I thought I'd share. My immediate need was to serve css, but static html, js, etc. could be done similarly. Also, I happen to have two namespaces in my struts2 app for security, which isn't really important here, except that it demonstrates how to serve s

Re: Display only 100 chars of a string

2009-06-22 Thread Dave Newton
Wes Wannemacher wrote: No, Jon, you are right... This belongs in the action class. Just because OGNL lets you cheat doesn't mean you should (cue Dave jumping in any minute). Hey! I'm of two minds regarding this... Truncating a string is really a view-layer issue, handled (or instigated) by a

Re: struts 2 -- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.

2009-06-22 Thread Dave Newton
laredotornado wrote: I do want to validate requests submitted to "pcFlow.do" (the action). I thought interceptors were the way to do it. My interceptor class is called "AccountsInterceptor". What is the proper way? All the tutorials suggest you have to create a custom interceptor stack. See

Re: Struts and more than one Servlet?

2009-06-22 Thread Dave Newton
Christian Benjamin Ries wrote: Hello together, I like to implement few servlets with struts2. The problem is, that I gets always a exception. See below this message. Every servlet has a struts.xml and log4j.properties file. Servlets with struts.xml files? It'd be helpful if you included the c

Re: Localization in struts 2

2009-06-22 Thread Dave Newton
You shouldn't need to do anything once the locale is set: the underlying Java I18N mechanism handles getting the right file. Have you actually tried it yet? I've never had to do anything particularly special to get I18N working--I think you're making it harder than it really is. Dave Johnso

RE: Display only 100 chars of a string

2009-06-22 Thread Martin Gainty
i couldnt get that to work either.. suggest setting the value and truncating the value to a new String variable in action class or setting the value and truncating the value to a new String variable in backing bean Martin Gainty __ Verzicht und Vert

Problem resetting the formBean.

2009-06-22 Thread JavierJaramillo
Hi Everyone, I'm new in struts. The project I'm working is HR search. These project consists in six fields to search in the form such ID, First Name, Last Name and etc. The project it is almost complete But one of the big problem is that I don't know how to reset the form bean. Well let me expl

Re: struts 2.1.6 crud app

2009-06-22 Thread jill juneja
I found a thread where user had same problem. It looks like it is a problem with oc4j. i am using JDeveloper and Oc4j 10.1.3 If anybody knows more could please somebody shed more light. If this can be fixed in this enviornment. Else I have to keep working on struts 10.1.3 On Mon, Jun 22, 2009 at

Re: struts 2 -- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.

2009-06-22 Thread laredotornado
Regarding ... > Also, is there any reason why you are changing the interceptor stack? You don't have validation and workflow, which seems a bit odd... I do want to validate requests submitted to "pcFlow.do" (the action). I thought interceptors were the way to do it. My interceptor class is cal

Re: Display only 100 chars of a string

2009-06-22 Thread Greg Lindholm
On Mon, Jun 22, 2009 at 12:07 PM, Stefano wrote: > @Greg: do u put that code inside the bean? i can't do this. > I put the abbreviate() method in the action class. It's actually in our 'base' action class so it's always available.

struts 2.1.6 crud app

2009-06-22 Thread jill juneja
I downloaded crud app from http://struts.apache.org/2.x/docs/crud-demo-i.html Every thing is working but - in s:url paramter is not being passed. I tired every thing. But employee object is always null despite it show in url correctly. In url it shows - http://149.10.178.12:8990/crud/crud!input.

Re: Display only 100 chars of a string

2009-06-22 Thread Wes Wannemacher
On Mon, Jun 22, 2009 at 12:32 PM, Jon Pearson wrote: > I could be wrong... > > Honestly, you'd be better off adding a function to your action class > that would format a string to a specific length. It would be clearer > what was going on. Something like > > public String formatString(String s, int

Re: struts 2 -- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.

2009-06-22 Thread Wes Wannemacher
Are you accessing a JSP page with struts tags in it by going directly to the JSP ? For instance, you should be hitting a URL similar to the following (based on the config you sent) - http://yourserver:8080/contextRoot/pcFlow.action Then, depending on what the return value of com.myco.regui.struts

RE: Display only 100 chars of a string

2009-06-22 Thread Jon Pearson
I could be wrong... Honestly, you'd be better off adding a function to your action class that would format a string to a specific length. It would be clearer what was going on. Something like public String formatString(String s, int maxLen) { return String.format("%." + maxLen + "s", s); } It

Re: Display only 100 chars of a string

2009-06-22 Thread Wes Wannemacher
On Mon, Jun 22, 2009 at 12:26 PM, Stefano Tranquillini wrote: > are you sure that this thing works? > because i don't see anything. > I'm inside an iterator , with this thing works   value="%{description}" /> with yours no. > seems that description is empty when i do value="@java.lang.str...@forma

struts 2 -- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.

2009-06-22 Thread laredotornado
Hi, I'm trying to migrate my app from struts 1 to struts 2. On a particular JSP page, I get this error The page generated an error: Exception: The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
are you sure that this thing works? because i don't see anything. I'm inside an iterator , with this thing works with yours no. seems that description is empty when i do On Mon, Jun 22, 2009 at 18:09, Jon Pearson wrote: > Sorry, I accidentally embedded double quotes inside double quotes, > here

RE: Display only 100 chars of a string

2009-06-22 Thread Jon Pearson
Sorry, I accidentally embedded double quotes inside double quotes, here's a fix: > -Original Message- > From: stefano.tranquill...@gmail.com > [mailto:stefano.tranquill...@gmail.com] On Behalf Of Stefano > Sent: Monday, June 22, 2009 12:07 PM > To: Struts Users Mailing List > Subject: R

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
@Greg: do u put that code inside the bean? i can't do this. @Jon thanks, but i've some problem with the " of the part: "%.100s" the system found a end tag " at the first " that it encountred. i tried to put \" but doesn't work. On Mon, Jun 22, 2009 at 18:00, Jon Pearson wrote: > > should work (ch

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano
@Greg: do u put that code inside the bean? i can't do this. @Jon thanks, but i've some problem with the " of the part: "%.100s" the system found a end tag " at the first " that it encountred. i tried to put \" but doesn't work. On Mon, Jun 22, 2009 at 18:00, Jon Pearson wrote: > > should work (ch

RE: Display only 100 chars of a string

2009-06-22 Thread Jon Pearson
should work (check http://www.opensymphony.com/ognl/html/LanguageGuide/staticMethods.html for OGNL for calling static methods) > -Original Message- > From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] > Sent: Monday, June 22, 2009 11:58 AM > To: Struts Users Mailing List

Re: Display only 100 chars of a string

2009-06-22 Thread Greg Lindholm
I have added an abbreviate() method to our base action class. /** * Abbreviate a string using ellipses (...). * If text is longer then len it is truncated to len characters then the * last 3 characters are replaced with ellipses (...). * * @param text the string to abb

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
On Mon, Jun 22, 2009 at 17:46, Jon Pearson wrote: > String.format("%.100s", s); how can i put this thing in the jsp? -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-

Re: redirect action in s:submit

2009-06-22 Thread Greg Lindholm
I just tested this (with 2.1.6) and it worked fine, no extra .action was appended. @Sam, Maybe you should: 1) double check which version of struts you are using 2) post the full tag 3) do a view source and post the tag that gets generated > What debugger can you suggest? Not sure how to ans

RE: Display only 100 chars of a string

2009-06-22 Thread Jon Pearson
That would cause an IndexOutOfBoundsException if the string was shorter than 100 chars. Try this instead: String.format("%.100s", s); That would return up to 100 characters from the beginning of the string 's'. > -Original Message- > From: Avlesh Singh [mailto:avl...@gmail.com] > Sent

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
i found a solution: On Mon, Jun 22, 2009 at 17:40, Jim Kiley wrote: > This seems like the kind of thing that is crying out for a custom tag -- > and > I don't say that lightly. I mean, a scriptlet could do it, but scriptlets > are from the devil. A custom tag would be a better solution, espec

Re: Display only 100 chars of a string

2009-06-22 Thread Avlesh Singh
Cheers Avlesh On Mon, Jun 22, 2009 at 9:07 PM, Stefano Tranquillini < stefano.tranquill...@gmail.com> wrote: > Hi all. > there's a possibility inside a jsp to display only the first 100 chars > or the first 10 words of a string? > if i have a long string, can i display only the first 100 chars

Re: Display only 100 chars of a string

2009-06-22 Thread Jim Kiley
This seems like the kind of thing that is crying out for a custom tag -- and I don't say that lightly. I mean, a scriptlet could do it, but scriptlets are from the devil. A custom tag would be a better solution, especially since this is a pretty general problem. jk On Mon, Jun 22, 2009 at 11:37

Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
Hi all. there's a possibility inside a jsp to display only the first 100 chars or the first 10 words of a string? if i have a long string, can i display only the first 100 chars directly in a jsp without modification in action or something like that? thanks -- Stefano

Re: redirect action in s:submit

2009-06-22 Thread Greg Lindholm
@Wes, I looked at both the 2.1.6 (that I'm using) and online svn followed the 2.0.6 tag. On Mon, Jun 22, 2009 at 11:13 AM, Wes Wannemacher wrote: > Which version of the source were you looking through? I recently did > some work with DefaultActionMapper, and this might be something that > has be

Re: redirect action in s:submit

2009-06-22 Thread Sam Wun
What debugger can you suggest? I also wantn to debug struts in portal, but when there is problem in a protlet, if there is no error msg in the protal log file, I can't see anything wrong in the portal page, because the portal simply refresh the portal page and show the first page. On Tue, Jun 23,

RE: redirect action in s:submit

2009-06-22 Thread Kofford, C Todd
Couldn't you do something like the following? ... redirect:%{myAction} I haven't personally tried this, but I've used plenty of "action" URLs with multiple parameters defined this way. Todd Kofford tkoff

Re: redirect action in s:submit

2009-06-22 Thread Wes Wannemacher
Which version of the source were you looking through? I recently did some work with DefaultActionMapper, and this might be something that has been fixed since 2.0.6. -Wes On Mon, Jun 22, 2009 at 11:04 AM, Greg Lindholm wrote: > From looking at the source it doesn't look like it should be adding t

Re: redirect action in s:submit

2009-06-22 Thread Greg Lindholm
>From looking at the source it doesn't look like it should be adding the .action extension so I would suggest you run it in the debugger and break in DefaultActionMapper and see where the .action is coming from. On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma wrote: > my Struts version is 2.0.6

Struts and more than one Servlet?

2009-06-22 Thread Christian Benjamin Ries
Hello together, I like to implement few servlets with struts2. The problem is, that I gets always a exception. See below this message. Every servlet has a struts.xml and log4j.properties file. When I start the servlets on itself, I get no start up problems but when I will start all servlets toget

Re: redirect action in s:submit

2009-06-22 Thread Bhaarat Sharma
my Struts version is 2.0.6 @Greg...I tried what you suggested..it works but not quite. "redirect:MyAction.action?param1=value1¶m2=value2" turns into the following url MyAction.action?PageSize=50&pageIndex=3.action problem is that it adds '.action' to the end... On Mon, Jun 22, 2009 at 10:04 AM,

Problem creating multiple radio buttons groups into an logic:iterate

2009-06-22 Thread Luis Ureña
First, thanks for your help I am having problems to build JSP with multiple questions and some radio buttons for each question. I am using two logic:iterate, one for questions and anotherone for answer for each question, like this:

Re: Doubt with using check box

2009-06-22 Thread Luis Ureña
Hi Vishnu To do that, I use javaScript as follow: First you must have an submit button with an event to fire that submit, like this: Update Second, you must write a javascript function that process the submit, like this: function submitThis() var sectionSelected = 0; try {

RE: redirect action in s:submit

2009-06-22 Thread Martin Gainty
attempt to decipher which version of struts the Op is using? thx, Martin __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir ho

Re: Can't redirect to another jsp page.

2009-06-22 Thread Paweł Wielgus
" Best greetings, Paweł Wielgus. 2009/6/22 Sam Wun : > OK I put the validation="false" in the struts-config.xml file, now I > got an error when I tried to load the page: > > 23:42:00,815 ERROR [PortletRequestDispatcherImpl:316] > javax.servlet.ServletException: File > "/html/onlinepayment_portle

RE: Struts 1.3.10 problem

2009-06-22 Thread Luis Esquivel
Hello Thank you for your response! Yes Actually I made a mistake on my email. We were using 1.2 prior. We went through the link you sent me here and followed it to the letter. What we are hopping is that somebody might have come across this type or problems that might be able to help us. Plea

Re: Can't redirect to another jsp page.

2009-06-22 Thread Paweł Wielgus
I don't know how it is for portlets, but for regular actions it can be done in struts-config.xml in the line like this: where validate is what You are looking for. Still it is not wright for me that You are posting a form and turning validation off, strange at least. Best greetings, Paweł Wielg

Re: Can't redirect to another jsp page.

2009-06-22 Thread Sam Wun
OK I put the validation="false" in the struts-config.xml file, now I got an error when I tried to load the page: 23:42:00,815 ERROR [PortletRequestDispatcherImpl:316] javax.servlet.ServletException: File "/html/onlinepayment_portlet/user_info.jsp" not found javax.servlet.ServletException: File "/h

Blank Page in 1.3.10

2009-06-22 Thread Luis Esquivel
Hello, We are seeing a problem with this version of struts that we haven't been able to resolve. I hope somebody can help. We had an old app in struts 1.1.X and decided to upgrade to 1.3.10. The application that has been working for quite a few years stopped working after doing the upgrade. H

Re: Freemarker error generated with CheckBox List

2009-06-22 Thread Zoran Avtarovski
Thanks Martin, The method won’t error out on null values. The first part of the method returns a false if either obj1 or obj2 are null. I’d already isolated the code. The problem I’m having is that the Array containing my checkbox selected values would occasionally contain a null value in the ar

Re: redirect action in s:submit

2009-06-22 Thread Greg Lindholm
On Mon, Jun 22, 2009 at 1:19 AM, dusty wrote: > > That works? What processes that redirect-action:PHAInformation parameter? > Struts sees that and just redirects? If I knew how that worked then I > could > figure out how to add parameters. > > Yes it works and it's part of the DefaultActionMapp

Re: Can't redirect to another jsp page.

2009-06-22 Thread Sam Wun
Hi, thanks for the suggestion. How to turn the validation off? Thanks 2009/6/22 Paweł Wielgus : > Hi Sam, > it is most likely caused by validation, > turn it off if that is the what You want to do. > > Best greetings, > Paweł Wielgus. > > > 2009/6/22 Sam Wun : >> Dear all, >> >> I have a Registr

Re: Can't redirect to another jsp page.

2009-06-22 Thread Paweł Wielgus
Hi Sam, it is most likely caused by validation, turn it off if that is the what You want to do. Best greetings, Paweł Wielgus. 2009/6/22 Sam Wun : > Dear all, > > I have a Registration form, when user click a Sign in button, the > OrderAction.java is supposed redirect it to another page, but > c

Can't redirect to another jsp page.

2009-06-22 Thread Sam Wun
Dear all, I have a Registration form, when user click a Sign in button, the OrderAction.java is supposed redirect it to another page, but currently it stay on the same page (the registration form). Please refer to the following codes: -- OrderAction.java /** @struts.action name="OrderForm" path=

RE: Localization in struts 2

2009-06-22 Thread Johnson nickel
I added this code, in my header.jsp page. So that user can select the preferred language Change Language | index.action?request_locale=en English | index.action?request_locale=fr French | index.action?request_locale=hi Hindi | This is working for in my particula

Freemarker error generated with CheckBox List

2009-06-22 Thread Zoran Avtarovski
I¹m getting a freemarker error when I use a s:checkboxlist tag and the array which contains my item values is empty. When I had a look at the stack trace it¹s pointing me to the following error: Caused by: java.lang.NullPointerException at org.apache.struts2.util.ContainUtil.contains(Con

Re: Struts2 and Security

2009-06-22 Thread Dave Newton
aum strut wrote: my main point was also this we were about to choose Spring Security but as we are not going to use Spring in our application so we were just a bit confused (:) ) if we can use this frame work even without using Spring?? You want to use Spring Security without Spring? Dave ---

Re: download link for struts UI Tags?

2009-06-22 Thread Nils-Helge Garli Hegvik
The Struts 2 core already includes the tag libraries. So if you have downloaded struts 2, then you also have the tag libraries you need. Struts distributions can be downloaded here: http://struts.apache.org/downloads.html Nils-H On Mon, Jun 22, 2009 at 10:46 AM, Sam Wun wrote: > Hi, > > Can anyon

RE: struts tags with "class" style format

2009-06-22 Thread Vishnu Vyasan Nelliparmbil
There is a attribute styleclass. -Original Message- From: Sam Wun [mailto:swun2...@gmail.com] Sent: 22 June 2009 12:47 To: Struts Users Mailing List Subject: struts tags with "class" style format Hi, I am very new to struts. I am wondering how to format the text on the submit butt

struts tags with "class" style format

2009-06-22 Thread Sam Wun
Hi, I am very new to struts. I am wondering how to format the text on the submit button with html class? I tried to do something like this: or but it has errors. Here is a list of struts libs I included in the jsp file: <%@ taglib uri="http://struts.apach

Re: Doubt with using check box

2009-06-22 Thread Paweł Wielgus
Hi Vishnu, in jsp add on every employee add such a checkbox and in EmployeeForm add field private String[] selectedEmployees; also don't forget to reset this field in reset method of that form. Hope that helps, Paweł Wielgus. 2009/6/20 Vishnu Vyasan Nelliparmbil : > > > Pawel ,

Re: download link for struts UI Tags?

2009-06-22 Thread Sam Wun
Hi, I actually want to use the struts UI tags " Zip+4 " Thanks On Mon, Jun 22, 2009 at 6:46 PM, Sam Wun wrote: > Hi, > > Can anyone tell me where can I downnload struts (2) UI Tags  library? > > Thanks > -

download link for struts UI Tags?

2009-06-22 Thread Sam Wun
Hi, Can anyone tell me where can I downnload struts (2) UI Tags library? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

RE: Localization in struts 2

2009-06-22 Thread Vishnu Vyasan Nelliparmbil
In action set the corresponding LOCALE. request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new java.util.Locale("en","US") ); So that Struts automatically takes the respective properties file. But remember to use the bean tags to display the text in views. ---

RE: Localization in struts 2

2009-06-22 Thread Johnson nickel
Can you explain in detail. i have ResourceBundle_hi.properties in my web-inf/classes dir where to define this location in struts.xml file. If, user select a particular language , how will reflect in all other pages. vishnu.vyasan wrote: > > > > The best way would be to keep the properties

RE: Localization in struts 2

2009-06-22 Thread Muthu Velappan
I agree with Vishnu if the project is small, say 20-25 Actions spread around 3-5 packages for the entire project. If it goes beyond that I would include a properties file named "package.properties" for each package and split the internationalization text based on each packages. I believe this will

Re: Creating SEO urls in struts 2.1

2009-06-22 Thread simplyolaf
I have added a working example in my blog. I didn't provide a pom so you need to manually copy the struts 2.1 libraries + convention plugin to the lib directory. Also you need to change local.properties to point to your application server. If you have any issue running this example please let me

To show and hide contents for struts2 div tag

2009-06-22 Thread HariniKaushik
Hi All, I want to show and hide some tags based on the selection in the drop down list. The code in jsp How can i go with the javascript show_details() method for showing the div 'box' on selecting 'W' and 'box1' on selecting 'S'? How can we use Dojo tag

RE: Localization in struts 2

2009-06-22 Thread Vishnu Vyasan Nelliparmbil
The best way would be to keep the properties file in the root folder and pecify the path in struts-config. So that you don’t have to write for all the packages. Keep an another properties file with name _FR.properties for french where you will define all the hindi properties. -Origin