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 filename_FR.properties for french where you will define all the hindi properties.

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 s:form action=Register method=post enctype=multipart/form-data s:select label=Occupation Type id=Workselect name=background.workType onchange=javascript:show_details(); headerKey=1

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

RE: Localization in struts 2

2009-06-22 Thread Johnson nickel
Hi, I have tried the sample project 'Struts2i18n' it's working fine. But, in my application i have different packages like, com.company.model, com.company.pojo etc., I need write properties file for all the packages. In struts.properties,whether, i need to define

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

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: download link for struts UI Tags?

2009-06-22 Thread Sam Wun
Hi, I actually want to use the struts UI tags s:, but I don't know where to download the library from. Hereis the code I want to implement: s:textfield label=City name=city / s:textfield label=State name=state / tr tdZip+4/td !-- Manually outputting our label -- td

Re: Doubt with using check box

2009-06-22 Thread Paweł Wielgus
Hi Vishnu, in jsp add on every employee add such a checkbox logic:iterate name=employeeForm property=employeeList id=employee html:multibox name=employeeForm property=selectedEmployees bean:write name=employee property=login/ /html:multibox /logic:iterate and in EmployeeForm add field

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: html:submit value=Cancel Checkout html:param class=jc_tran_input/ /html:submit or html:submit value=Cancel Checkout

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

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 Wunswun2...@gmail.com wrote:

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

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

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 div align=rightChange Language | index.action?request_locale=en English | index.action?request_locale=fr French | index.action?request_locale=hi Hindi | /div This is working

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

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 swun2...@gmail.com: Dear all, I have a Registration form, when user click a Sign in button, the OrderAction.java is supposed redirect it to

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 poulw...@gmail.com: 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 swun2...@gmail.com: Dear

Re: redirect action in s:submit

2009-06-22 Thread Greg Lindholm
On Mon, Jun 22, 2009 at 1:19 AM, dusty dustin_pea...@yahoo.com 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

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

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.

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 quot;/html/onlinepayment_portlet/user_info.jspquot; not found javax.servlet.ServletException:

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: action name=regionsEditForm path=/admin/regions/list type=com.pi.eplatform.suirz.user.action.admin.ListRegionsAction validate=false where validate is what You are looking

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.

Re: Can't redirect to another jsp page.

2009-06-22 Thread Paweł Wielgus
Best greetings, Paweł Wielgus. 2009/6/22 Sam Wun swun2...@gmail.com: 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

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

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: html:button property=actualizar onclick=submitThis();Update/html:button Second, you must write a javascript function that process the submit, like this:

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: logic:iterate id=questions name=unicaBean indexId=index TR

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

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 bhaara...@gmail.comwrote: my Struts

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=value1param2=value2 turns into the following url MyAction.action?PageSize=50pageIndex=3.action problem is that it adds '.action' to the end... On Mon, Jun 22, 2009 at 10:04

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 Lindholmgreg.lindh...@gmail.com wrote: From looking at the source it doesn't look

RE: redirect action in s:submit

2009-06-22 Thread Kofford, C Todd
Couldn't you do something like the following? s:url id=myAction action=MyAction s:param name=param1 value=value1 / s:param name=param2 value=value2 / s:param name=param3 value=value3 / /s:url ...

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 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 w...@wantii.com wrote: Which version of the source were you looking through? I recently did some work with DefaultActionMapper, and this might be something

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

Re: Display only 100 chars of a string

2009-06-22 Thread Avlesh Singh
c:out value=${fn:substring(yourString, start, end)}/ 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

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
i found a solution: s:property value=%{description.substring(0,200)} / On Mon, Jun 22, 2009 at 17:40, Jim Kiley jhki...@summa-tech.com 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

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: 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 s:submit tag 3) do a view source and post the input tag that gets generated What debugger can you suggest? Not

Re: Display only 100 chars of a string

2009-06-22 Thread Stefano Tranquillini
On Mon, Jun 22, 2009 at 17:46, Jon Pearsonjon.pear...@sixnet.com 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

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 (...).br * 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

RE: Display only 100 chars of a string

2009-06-22 Thread Jon Pearson
s:property value=@java.lang.str...@format(%.100s, description) / 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:

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 s:property value=%{description} / with yours no. seems that description is empty when i do s:property value=@java.lang.str...@format('%.100s', description) / On Mon, Jun 22, 2009 at

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 Wes Wannemacher
On Mon, Jun 22, 2009 at 12:26 PM, Stefano Tranquillinistefano.tranquill...@gmail.com wrote: are you sure that this thing works? because i don't see anything. I'm inside an iterator , with this thing works  s:property value=%{description} / with yours no. seems that description is empty when i

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

Re: Display only 100 chars of a string

2009-06-22 Thread Wes Wannemacher
On Mon, Jun 22, 2009 at 12:32 PM, Jon Pearsonjon.pear...@sixnet.com 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

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 Pearsonjon.pear...@sixnet.com wrote:

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 Pearsonjon.pear...@sixnet.com wrote:

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: s:property value=@java.lang.str...@format('%.100s', description) / -Original Message- From: stefano.tranquill...@gmail.com [mailto:stefano.tranquill...@gmail.com] On Behalf Of Stefano Sent: Monday, June

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 -

Re: Display only 100 chars of a string

2009-06-22 Thread Greg Lindholm
On Mon, Jun 22, 2009 at 12:07 PM, Stefano elste...@gmail.com 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.

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

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

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

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

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

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

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

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, rtdr...@mailinator.com 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.

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

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 security-constraint web-resource-collection web-resource-nameAll JSP direct access/web-resource-name url-pattern/jsp/*/url-pattern http-methodPOST/http-method http-methodGET/http-method /web-resource-collection

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