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.





-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 09:58
To: user@struts.apache.org
Subject: RE: Localization in struts 2



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

struts.custom.i18n.resources=com.kogent.ResourceBundle 
struts.custom.i18n.resources=com.company.model
struts.custom.i18n.resources=com.company.pojo 

And one more thing,for ex, If user select hindi 
index.action?request_locale=hi Hindi 

i need to change all hindi text in throughout my application all the jsp
pages. 
Can you  give me suggestion



 

Muthu Velappan wrote:
> 
> I think if an app has to support internationalization then all text should
> be written from properties file and not through static images content. So,
> I
> would be remove images and try to get write all text from properties file
> only.
>  
> For Dynamic Data Issue - I believe you fetch the content from database. If
> you want to show them also in hindi then you should maintain that in db as
> well. For example: you want show all countries in English as well hindi. 
> 
> Then your countries table should be like this
> 
> Countryid namename_hi
> name_fr 
> 1 India content>
> 2 UK   -do-   -do-
> 3 USA  -do-   -do-
> and so no...
> 
> While fetching you have to pass the ISO language code along with request
> and
> fetch data from respective column. This is one way of solving your issue.
> I
> don’t know how much of dynamic content you want to show like this. If you
> have a very huge list then this would be a very difficult job to complete.
> 
> Regards,
> Muthu
> 
> -Original Message-
> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
> Sent: Thursday, June 18, 2009 1:15 PM
> To: user@struts.apache.org
> Subject: RE: Localization in struts 2
> 
> 
> 
> Thank you.. it's working fine. I have other issue.. in my application most 
> of the places i used the images. I want to change images(like
> username,password) also in hindi. 
> 
> And, using this method, i can display the text from properties file only.
> in
> my application
> i have some dynamic data to add some data..for that i need to display in
> hindi only..
> 
> Can you me a suggestions it will be helpful for further work. I 'm using
> struts 2 framework.
> 
> 
> Muthu Velappan wrote:
>> 
>> Try this...
>> 
>> Take a copy of ur current properties file and name it as
>> hinditext.txt(save
>> it in UTF-8 format)
>> 
>> Now open command prompt and go to your /bin folder and run
>> this
>> command 
>> 
>> native2ascii -encoding UTF-8 
>> 
>> 
>> Now rename this app_hi.properties file with respect to ur application
>> properties file and copy to the required place. Restart the server you
>> should be able to see the hindi text properly in browser.
>> 
>> Hope this solves your problem.
>> 
>> Thanks,
>> Muthu
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: Thursday, June 18, 2009 12:28 PM
>> To: user@struts.apache.org
>> Subject: Re: Localization in struts 2
>> 
>> 
>> I have tried to copy the properties files text and opening in notepad
>> while saving i had selected the encoding type as UTF-8. But still i'm not 
>> able to see the hindi text in browser.
>> 
>> And in my jsp i have added ,
>>  <%@ page language="java" pageEncoding="utf-8"
>> contentType="text/html;charset=utf-8"%> 
>> 
>> 
>> 
>> 
>> Girish Naik wrote:
>>> 
>>> Is the Hindi text specified in the file in UTF8 format? ie /u0092 etc.
>>> 
>>> 
>>> 
>>> Regards,
>>> -
>>> Girish Naik
>>> Mobile:-+91-09740091638
>>> girish.n...@gmail.com
>>> 
>>> Mitch
>>> Hedberg
>>> - "I drank some boiling water because I wanted to whistle."
>>> 
>>> On Thu, Jun 18, 2009 at 10:45 AM, Johnson nickel
>>> wrote:
>>> 

 Hi all,

I have tried the Struts2i18n sample project it's working fine.
 But
 i
 need to
 implement local language in the same manner. I have created
 ResourceBundle_Hi.properties for
 hindi language. I had specified the hindi text in this file. when i try
 to
 execute the application
 it shows some नाम: or ???. It's not actually taken the proper
 file.Give me a suggestions for this
 issue
 --
 View thi

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 tags to accomplish the same?

Appreciate any help!!!

Thanks,
Harini
-- 
View this message in context: 
http://www.nabble.com/To-show-and-hide-contents-for-struts2-div-tag-tp24142623p24142623.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



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

http://simplyolaf.blogspot.com/2009/06/creating-hierarchical-actions-in-struts.html
Creating Hierarchical/SEO URLs in Struts 2  


simplyolaf wrote:
> 
> I just wanted to share with you a step by step tutorial on how to create
> SEO hieararchical urls in struts2 using the convention plugin. A couple of
> hacks are needed but they are pretty straightforward. If you know a better
> way of doing the same thing please let me know:
> 
> http://simplyolaf.blogspot.com/2009/06/creating-hierarchical-actions-in-struts.html
> Creating Hierarchical/SEO URLs in Struts 2  
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-SEO-urls-in-struts-2.1-tp24019389p24142636.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



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 be
more manageable than having a single properties file with 1000's of line...

~Muthu

-Original Message-
From: Vishnu Vyasan Nelliparmbil [mailto:vis...@mun.gov.bh]  
Sent: Monday, June 22, 2009 12:33 PM
To: Struts Users Mailing List
Subject: RE: Localization in struts 2



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.





-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 09:58
To: user@struts.apache.org
Subject: RE: Localization in struts 2



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

struts.custom.i18n.resources=com.kogent.ResourceBundle 
struts.custom.i18n.resources=com.company.model
struts.custom.i18n.resources=com.company.pojo 

And one more thing,for ex, If user select hindi 
index.action?request_locale=hi Hindi 

i need to change all hindi text in throughout my application all the jsp
pages. 
Can you  give me suggestion



 

Muthu Velappan wrote:
> 
> I think if an app has to support internationalization then all text should
> be written from properties file and not through static images content. So,
> I
> would be remove images and try to get write all text from properties file
> only.
>  
> For Dynamic Data Issue - I believe you fetch the content from database. If
> you want to show them also in hindi then you should maintain that in db as
> well. For example: you want show all countries in English as well hindi. 
> 
> Then your countries table should be like this
> 
> Countryid namename_hi
> name_fr 
> 1 India content>
> 2 UK   -do-   -do-
> 3 USA  -do-   -do-
> and so no...
> 
> While fetching you have to pass the ISO language code along with request
> and
> fetch data from respective column. This is one way of solving your issue.
> I
> don’t know how much of dynamic content you want to show like this. If you
> have a very huge list then this would be a very difficult job to complete.
> 
> Regards,
> Muthu
> 
> -Original Message-
> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
> Sent: Thursday, June 18, 2009 1:15 PM
> To: user@struts.apache.org
> Subject: RE: Localization in struts 2
> 
> 
> 
> Thank you.. it's working fine. I have other issue.. in my application most

> of the places i used the images. I want to change images(like
> username,password) also in hindi. 
> 
> And, using this method, i can display the text from properties file only.
> in
> my application
> i have some dynamic data to add some data..for that i need to display in
> hindi only..
> 
> Can you me a suggestions it will be helpful for further work. I 'm using
> struts 2 framework.
> 
> 
> Muthu Velappan wrote:
>> 
>> Try this...
>> 
>> Take a copy of ur current properties file and name it as
>> hinditext.txt(save
>> it in UTF-8 format)
>> 
>> Now open command prompt and go to your /bin folder and run
>> this
>> command 
>> 
>> native2ascii -encoding UTF-8 
>> 
>> 
>> Now rename this app_hi.properties file with respect to ur application
>> properties file and copy to the required place. Restart the server you
>> should be able to see the hindi text properly in browser.
>> 
>> Hope this solves your problem.
>> 
>> Thanks,
>> Muthu
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: Thursday, June 18, 2009 12:28 PM
>> To: user@struts.apache.org
>> Subject: Re: Localization in struts 2
>> 
>> 
>> I have tried to copy the properties files text and opening in notepad
>> while saving i had selected the encoding type as UTF-8. But still i'm not

>> able to see the hindi text in browser.
>> 
>> And in my jsp i have added ,
>>  <%@ page language="java" pageEncoding="utf-8"
>> contentType="text/html;charset=utf-8"%> 
>> 
>> 
>> 
>> 
>> Girish Naik wrote:
>>> 
>>> Is the Hindi text specified in the file in UTF8 format? ie /u0092 etc.
>>> 
>>> 
>>> 
>>> Regards,
>>> -
>>> Girish Naik
>>> Mobile:-+91-09740091638
>>> girish.n...@gmail.com
>>> 
>>> Mitch
>>> Hedberg
>>> - "I drank some boiling water because I wan

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 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.
> 
> 
> 
> 
> 
> -Original Message-
> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
> Sent: 22 June 2009 09:58
> To: user@struts.apache.org
> Subject: RE: Localization in struts 2
> 
> 
> 
> 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
> 
> struts.custom.i18n.resources=com.kogent.ResourceBundle 
> struts.custom.i18n.resources=com.company.model
> struts.custom.i18n.resources=com.company.pojo 
> 
> And one more thing,for ex, If user select hindi 
> index.action?request_locale=hi Hindi 
> 
> i need to change all hindi text in throughout my application all the jsp
> pages. 
> Can you  give me suggestion
> 
> 
> 
>  
> 
> Muthu Velappan wrote:
>> 
>> I think if an app has to support internationalization then all text
>> should
>> be written from properties file and not through static images content.
>> So,
>> I
>> would be remove images and try to get write all text from properties file
>> only.
>>  
>> For Dynamic Data Issue - I believe you fetch the content from database.
>> If
>> you want to show them also in hindi then you should maintain that in db
>> as
>> well. For example: you want show all countries in English as well hindi. 
>> 
>> Then your countries table should be like this
>> 
>> Countryidnamename_hi
>> name_fr 
>> 1India> content>
>> 2UK   -do-   -do-
>> 3USA  -do-   -do-
>> and so no...
>> 
>> While fetching you have to pass the ISO language code along with request
>> and
>> fetch data from respective column. This is one way of solving your issue.
>> I
>> don’t know how much of dynamic content you want to show like this. If you
>> have a very huge list then this would be a very difficult job to
>> complete.
>> 
>> Regards,
>> Muthu
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: Thursday, June 18, 2009 1:15 PM
>> To: user@struts.apache.org
>> Subject: RE: Localization in struts 2
>> 
>> 
>> 
>> Thank you.. it's working fine. I have other issue.. in my application
>> most 
>> of the places i used the images. I want to change images(like
>> username,password) also in hindi. 
>> 
>> And, using this method, i can display the text from properties file only.
>> in
>> my application
>> i have some dynamic data to add some data..for that i need to display in
>> hindi only..
>> 
>> Can you me a suggestions it will be helpful for further work. I 'm using
>> struts 2 framework.
>> 
>> 
>> Muthu Velappan wrote:
>>> 
>>> Try this...
>>> 
>>> Take a copy of ur current properties file and name it as
>>> hinditext.txt(save
>>> it in UTF-8 format)
>>> 
>>> Now open command prompt and go to your /bin folder and run
>>> this
>>> command 
>>> 
>>> native2ascii -encoding UTF-8 
>>> 
>>> 
>>> Now rename this app_hi.properties file with respect to ur application
>>> properties file and copy to the required place. Restart the server you
>>> should be able to see the hindi text properly in browser.
>>> 
>>> Hope this solves your problem.
>>> 
>>> Thanks,
>>> Muthu
>>> 
>>> -Original Message-
>>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>>> Sent: Thursday, June 18, 2009 12:28 PM
>>> To: user@struts.apache.org
>>> Subject: Re: Localization in struts 2
>>> 
>>> 
>>> I have tried to copy the properties files text and opening in notepad
>>> while saving i had selected the encoding type as UTF-8. But still i'm
>>> not 
>>> able to see the hindi text in browser.
>>> 
>>> And in my jsp i have added ,
>>>  <%@ page language="java" pageEncoding="utf-8"
>>> contentType="text/html;charset=utf-8"%> 
>>> 
>>> 
>>> 
>>> 
>>> Girish Naik wrote:
 
 Is the Hindi text specified in the file in UTF8 format? ie /u0092 etc.
 
 
 
 Regards,
 -
 Girish Naik
 Mobile:-+91-09740091638
 girish.n...@gmail.com
 
 Mitch
 Hedberg
 - "I drank some boiling water because I wanted to whistle."
 
 On Thu, Jun 18, 2009 at 10:45 AM, Johnson nickel
 wrote:
 
>
> Hi all,
>>>

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. 

-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 11:28
To: user@struts.apache.org
Subject: RE: Localization in struts 2


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 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.
> 
> 
> 
> 
> 
> -Original Message-
> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
> Sent: 22 June 2009 09:58
> To: user@struts.apache.org
> Subject: RE: Localization in struts 2
> 
> 
> 
> 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
> 
> struts.custom.i18n.resources=com.kogent.ResourceBundle 
> struts.custom.i18n.resources=com.company.model
> struts.custom.i18n.resources=com.company.pojo 
> 
> And one more thing,for ex, If user select hindi 
> index.action?request_locale=hi Hindi 
> 
> i need to change all hindi text in throughout my application all the jsp
> pages. 
> Can you  give me suggestion
> 
> 
> 
>  
> 
> Muthu Velappan wrote:
>> 
>> I think if an app has to support internationalization then all text
>> should
>> be written from properties file and not through static images content.
>> So,
>> I
>> would be remove images and try to get write all text from properties file
>> only.
>>  
>> For Dynamic Data Issue - I believe you fetch the content from database.
>> If
>> you want to show them also in hindi then you should maintain that in db
>> as
>> well. For example: you want show all countries in English as well hindi. 
>> 
>> Then your countries table should be like this
>> 
>> Countryidnamename_hi
>> name_fr 
>> 1India> content>
>> 2UK   -do-   -do-
>> 3USA  -do-   -do-
>> and so no...
>> 
>> While fetching you have to pass the ISO language code along with request
>> and
>> fetch data from respective column. This is one way of solving your issue.
>> I
>> don’t know how much of dynamic content you want to show like this. If you
>> have a very huge list then this would be a very difficult job to
>> complete.
>> 
>> Regards,
>> Muthu
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: Thursday, June 18, 2009 1:15 PM
>> To: user@struts.apache.org
>> Subject: RE: Localization in struts 2
>> 
>> 
>> 
>> Thank you.. it's working fine. I have other issue.. in my application
>> most 
>> of the places i used the images. I want to change images(like
>> username,password) also in hindi. 
>> 
>> And, using this method, i can display the text from properties file only.
>> in
>> my application
>> i have some dynamic data to add some data..for that i need to display in
>> hindi only..
>> 
>> Can you me a suggestions it will be helpful for further work. I 'm using
>> struts 2 framework.
>> 
>> 
>> Muthu Velappan wrote:
>>> 
>>> Try this...
>>> 
>>> Take a copy of ur current properties file and name it as
>>> hinditext.txt(save
>>> it in UTF-8 format)
>>> 
>>> Now open command prompt and go to your /bin folder and run
>>> this
>>> command 
>>> 
>>> native2ascii -encoding UTF-8 
>>> 
>>> 
>>> Now rename this app_hi.properties file with respect to ur application
>>> properties file and copy to the required place. Restart the server you
>>> should be able to see the hindi text properly in browser.
>>> 
>>> Hope this solves your problem.
>>> 
>>> Thanks,
>>> Muthu
>>> 
>>> -Original Message-
>>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>>> Sent: Thursday, June 18, 2009 12:28 PM
>>> To: user@struts.apache.org
>>> Subject: Re: Localization in struts 2
>>> 
>>> 
>>> I have tried to copy the properties files text and opening in notepad
>>> while saving i had selected the encoding type as UTF-8. But still i'm
>>> not 
>>> able to see the hindi text in browser.
>>> 
>>> And in my jsp i have added ,
>>>  <%@ page language="java" pageEncoding="utf-8"
>>> contentType="text/html;charset=utf-8"%> 
>>> 
>>> 
>>> 
>>> 
>>> Girish Naik wrote:
 
 Is the Hindi text specified in 

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 "


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
>

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



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 , can you expalin  with a example. I am totally new to struts.
>
> I tried with another way.
>
> Ie by adding a 'selected' field to the EmployeeBean.
>
> 
> 
>         
>          />
>         onchange="checkEmployee();" > 
> 
> 
>
> Now I am getting the values of selected as false in the Action. Even though I 
> have selected it.
> I am using a action form for the some other elements in the same view.
>
> Could you guys can through some light on how to make this work?
>
>
> Regards
> Vishnu
>
>
>
> -Original Message-
> From: Paweł Wielgus [mailto:poulw...@gmail.com]
> Sent: 20 June 2009 10:40
> To: Struts Users Mailing List
> Subject: Re: Doubt with using check box
>
> Hi Vishnu,
> on the html page you will have a list of checkboxes with the same name
> "selectedEmployees" and a value of an employee identificator. In the
> action create settet setSelectedEmloyees(String[] selectedEmployees),
> then in execute You can access this table of employee identificators.
> Just as a side note, i don't know what type of is your employee
> identificator, so i proposed String, but it can also be long.
>
> Best greetings,
> Pawel Wielgus.
>
> 2009/6/20, Vishnu Vyasan Nelliparmbil :
>> Hi Friends,
>>
>> I am new to web development and struts. I have a simple question.
>>
>> I am using  tag to iterate through a list of Employees
>> and display their details.
>> The list contains the Employee objects.
>> Now while displaying Employee details in a table, the row is ending with
>> a check box , so that the user can select employees. The check boxes are
>> created dynamically since they are inside the iterate tag.
>>
>> Now how in Action I know that a specific employee is selected?
>>
>> In action form I would get whether the check box is selected or not. But
>> how can I relate that to employees in list?
>>
>> Thanks in Advance
>> vishnu
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> -
> 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



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.apache.org/tags-bean"; prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %>

Not sure what other libraries I have include here, but I can't write
the following struts code:





It siad param is not part of the library, something like that.


Please help.

Thanks

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



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 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.apache.org/tags-bean"; prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %>

Not sure what other libraries I have include here, but I can't write
the following struts code:





It siad param is not part of the library, something like that.


Please help.

Thanks

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

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



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

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



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(ContainUtil.java:96)

When I had a look at the source for ContainUtil, I noticed that the equals
expression is arse about.

if (obj1.getClass().isArray()) {
for (int i = 0; i < Array.getLength(obj1); i++) {
Object value = null;
value = Array.get(obj1, i);

(Error is thrown here)  if (value.equals(obj2)) {
//log.debug("obj1 is an array and contains obj2");
return true;
}
}

Ideally the expression would be best rewritten if(obj2.equals(value))  as we
have already tested obj2 for nullness at the start of the contains method.

Now the hard part, I don¹t want to have to recompile the struts code and was
hoping there was a simple workaround.

All suggestions considered at this point.

TIA 

Z.


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 particular package only.Because i need to execute
the action file
// index.action
public String execute() throws Exception{

request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("fr","FR"));

}


using this each time i need to execute the action file. can i add for
multiple 
language file??( like this code)

request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("fr","FR"));
request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("en","US"));

-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 11:28
To: user@struts.apache.org
Subject: RE: Localization in struts 2


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 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.
> 
> 
> 
> 
> 
> -Original Message-
> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
> Sent: 22 June 2009 09:58
> To: user@struts.apache.org
> Subject: RE: Localization in struts 2
> 
> 
> 
> 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
> 
> struts.custom.i18n.resources=com.kogent.ResourceBundle 
> struts.custom.i18n.resources=com.company.model
> struts.custom.i18n.resources=com.company.pojo 
> 
> And one more thing,for ex, If user select hindi 
> index.action?request_locale=hi Hindi 
> 
> i need to change all hindi text in throughout my application all the jsp
> pages. 
> Can you  give me suggestion
> 
> 
> 
>  
> 
> Muthu Velappan wrote:
>> 
>> I think if an app has to support internationalization then all text
>> should
>> be written from properties file and not through static images content.
>> So,
>> I
>> would be remove images and try to get write all text from properties file
>> only.
>>  
>> For Dynamic Data Issue - I believe you fetch the content from database.
>> If
>> you want to show them also in hindi then you should maintain that in db
>> as
>> well. For example: you want show all countries in English as well hindi. 
>> 
>> Then your countries table should be like this
>> 
>> Countryidnamename_hi
>> name_fr 
>> 1India> content>
>> 2UK   -do-   -do-
>> 3USA  -do-   -do-
>> and so no...
>> 
>> While fetching you have to pass the ISO language code along with request
>> and
>> fetch data from respective column. This is one way of solving your issue.
>> I
>> don’t know how much of dynamic content you want to show like this. If you
>> have a very huge list then this would be a very difficult job to
>> complete.
>> 
>> Regards,
>> Muthu
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: Thursday, June 18, 2009 1:15 PM
>> To: user@struts.apache.org
>> Subject: RE: Localization in struts 2
>> 
>> 
>> 
>> Thank you.. it's working fine. I have other issue.. in my application
>> most 
>> of the places i used the images. I want to change images(like
>> username,password) also in hindi. 
>> 
>> And, using this method, i can display the text from properties file only.
>> in
>> my application
>> i have some dynamic data to add some data..for that i need to display in
>> hindi only..
>> 
>> Can you me a suggestions it will be helpful for further work. I 'm using
>> struts 2 framework.
>> 
>> 
>> Muthu Velappan wrote:
>>> 
>>> Try this...
>>> 
>>> Take a copy of ur current properties file and name it as
>>> hinditext.txt(save
>>> it in UTF-8 format)
>>> 
>>> Now open command prompt and go to your /bin folder and run
>>> this
>>> command 
>>> 
>>> native2ascii -encoding UTF-8 
>>> 
>>> 
>>> Now rename this app_hi.properties file with respect to ur application
>>> properties file and copy to the required place. Restart the server you
>>> should be able to see the hindi text properly in browser.
>>> 
>>> Hope this solves your problem.
>>> 
>>> Thanks,
>>> Muthu
>>> 
>>> -Original Message-
>>> From: Johnson nickel [mail

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="/onlinepayment_portlet/reg"
 * scope="session"
 * input="/portlet/onlinepayment_portlet/reg.jsp"
 *
 * @struts.action-forward name="/onlinepayment_portlet/reg"
path="/onlinepayment_portlet/reg.jsp"
 * @struts.action-forward name="/onlinepayment_portlet/user_info"
path="/onlinepayment_portlet/user_info.jsp"
 */

public class OrderAction extends PortletAction{

/*
public ActionForward execute(ActionMapping mapping,ActionForm
form, HttpServletRequest request, HttpServletResponse response) throws
IOException,ServletException{
return mapping.findForward("success");
}
*/

public ActionForward execute(
ActionMapping mapping, ActionForm form,
HttpServletRequest req,
HttpServletResponse res)
throws Exception {

   //Get form and initialize only if number list not empty
   OrderForm orderForm = (OrderForm) form;

String pw = orderForm.getPassword().trim();
String emailaddr = orderForm.getEmailAddress().trim();
   if (pw.length() > 0 && emailaddr.length() > 0 ) {
  return
mapping.findForward("/onlinepayment_portlet/user_info");
}
else
return
mapping.findForward("/onlinepayment_portlet/user_info");
}


public ActionForward render(
ActionMapping mapping, ActionForm form,
PortletConfig config,
RenderRequest req, RenderResponse res)
throws Exception {

OrderForm orderForm = (OrderForm)form;

return mapping.findForward("/onlinepayment_portlet/user_info");
}
}

-- reg.jsp:
<%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>






  

  
  

 

  
  



  

  
Password

  
  

  

  
  




  
  



  
  

   
   
  
  

  


-- user_info.jsp

<%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>









  

  

  
  
 

 
  

   Password 
 
  
 
   
   
   

  
  
  
  

  


Your help is much appreciated.
Thanks

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



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
> currently it stay on the same page (the registration form).
> Please refer to the following codes:
>
> -- OrderAction.java
>
> /** @struts.action name="OrderForm" path="/onlinepayment_portlet/reg"
>  * scope="session"
>  * input="/portlet/onlinepayment_portlet/reg.jsp"
>  *
>  * @struts.action-forward name="/onlinepayment_portlet/reg"
> path="/onlinepayment_portlet/reg.jsp"
>  * @struts.action-forward name="/onlinepayment_portlet/user_info"
> path="/onlinepayment_portlet/user_info.jsp"
>  */
>
> public class OrderAction extends PortletAction{
>
> /*
>    public ActionForward execute(ActionMapping mapping,ActionForm
> form, HttpServletRequest request, HttpServletResponse response) throws
> IOException,ServletException{
>        return mapping.findForward("success");
>    }
> */
>
>        public ActionForward execute(
>                        ActionMapping mapping, ActionForm form,
> HttpServletRequest req,
>                        HttpServletResponse res)
>                throws Exception {
>
>               //Get form and initialize only if number list not empty
>               OrderForm orderForm = (OrderForm) form;
>
>                String pw = orderForm.getPassword().trim();
>                String emailaddr = orderForm.getEmailAddress().trim();
>               if (pw.length() > 0 && emailaddr.length() > 0 ) {
>                  return
> mapping.findForward("/onlinepayment_portlet/user_info");
>                }
>                else
>                        return
> mapping.findForward("/onlinepayment_portlet/user_info");
>        }
>
>
>        public ActionForward render(
>                        ActionMapping mapping, ActionForm form,
> PortletConfig config,
>                        RenderRequest req, RenderResponse res)
>                throws Exception {
>
>                OrderForm orderForm = (OrderForm)form;
>
>                return mapping.findForward("/onlinepayment_portlet/user_info");
>        }
> }
>
> -- reg.jsp:
> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>
>  property="emailAddress" type="java.lang.String" />
>
>  focus="emailAddress">
>
> 
>  
>     key="form.email_address"/>
>  
>  
>    
>     
>    
>  
>  
>    
>
>    
>  
>
>  
>    Password
>
>  
>  
>    
>       class="jc_tran_input">
>    
>  
>  
>    
>
>    
>
>  
>  
>    
>
>    
>  
>  
>    
>   
>   
>      
>      
>    
>  
> 
>
> -- user_info.jsp
>
> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>
>  type="java.lang.String" />
>  type="java.lang.String" />
>  property="shippingAddress" type="java.lang.String" />
>  property="billingAddress" type="java.lang.String" />
>
>  focus="emailAddress">
>
> 
>  
>         key="form.firstname"/>
>          size="50" /> 
>         key="form.lastname"/>
>          size="50" /> 
>  
>     
>    key="form.email_address"/> 
>     size="50" /> 
>  
>
>   Password 
>     size="50" value="" class="jc_tran_input"> 
>  
>     
>   
>   
>   
>
>      
>      
>      
>      
>    
>  
> 
>
> Your help is much appreciated.
> Thanks
>
> -
> 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: 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 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="/onlinepayment_portlet/reg"
>>  * scope="session"
>>  * input="/portlet/onlinepayment_portlet/reg.jsp"
>>  *
>>  * @struts.action-forward name="/onlinepayment_portlet/reg"
>> path="/onlinepayment_portlet/reg.jsp"
>>  * @struts.action-forward name="/onlinepayment_portlet/user_info"
>> path="/onlinepayment_portlet/user_info.jsp"
>>  */
>>
>> public class OrderAction extends PortletAction{
>>
>> /*
>>    public ActionForward execute(ActionMapping mapping,ActionForm
>> form, HttpServletRequest request, HttpServletResponse response) throws
>> IOException,ServletException{
>>        return mapping.findForward("success");
>>    }
>> */
>>
>>        public ActionForward execute(
>>                        ActionMapping mapping, ActionForm form,
>> HttpServletRequest req,
>>                        HttpServletResponse res)
>>                throws Exception {
>>
>>               //Get form and initialize only if number list not empty
>>               OrderForm orderForm = (OrderForm) form;
>>
>>                String pw = orderForm.getPassword().trim();
>>                String emailaddr = orderForm.getEmailAddress().trim();
>>               if (pw.length() > 0 && emailaddr.length() > 0 ) {
>>                  return
>> mapping.findForward("/onlinepayment_portlet/user_info");
>>                }
>>                else
>>                        return
>> mapping.findForward("/onlinepayment_portlet/user_info");
>>        }
>>
>>
>>        public ActionForward render(
>>                        ActionMapping mapping, ActionForm form,
>> PortletConfig config,
>>                        RenderRequest req, RenderResponse res)
>>                throws Exception {
>>
>>                OrderForm orderForm = (OrderForm)form;
>>
>>                return 
>> mapping.findForward("/onlinepayment_portlet/user_info");
>>        }
>> }
>>
>> -- reg.jsp:
>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>
>> > property="emailAddress" type="java.lang.String" />
>>
>> > focus="emailAddress">
>>
>> 
>>  
>>    > key="form.email_address"/>
>>  
>>  
>>    
>>     
>>    
>>  
>>  
>>    
>>
>>    
>>  
>>
>>  
>>    Password
>>
>>  
>>  
>>    
>>      > class="jc_tran_input">
>>    
>>  
>>  
>>    
>>
>>    
>>
>>  
>>  
>>    
>>
>>    
>>  
>>  
>>    
>>   
>>   
>>      
>>      
>>    
>>  
>> 
>>
>> -- user_info.jsp
>>
>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>
>> > type="java.lang.String" />
>> > type="java.lang.String" />
>> > property="shippingAddress" type="java.lang.String" />
>> > property="billingAddress" type="java.lang.String" />
>>
>> > focus="emailAddress">
>>
>> 
>>  
>>        > key="form.firstname"/>
>>         > size="50" /> 
>>        > key="form.lastname"/>
>>         > size="50" /> 
>>  
>>     
>>   > key="form.email_address"/> 
>>    > size="50" /> 
>>  
>>
>>   Password 
>>    > size="50" value="" class="jc_tran_input"> 
>>  
>>     
>>   
>>   
>>   
>>
>>      
>>      
>>      
>>      
>>    
>>  
>> 
>>
>> Your help is much appreciated.
>> Thanks
>>
>> -
>> 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
>
>

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



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 DefaultActionMapper.  I don't think you
will be able to add parameters using the "redirect-action:" prefix. I
haven't try it but you should be able to use the "redirect:" prefix and
construct the url with parameters like this
"redirect:MyAction.action?param1=value1¶m2=value2".


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 array (this was from a legacy system and I couldn’t easily do
anything with it).

In the end I added a workaround by iterating through the array and
discarding null values.

I still think the equals code for arrays should be the other way around as
it is for Iterable. That way it won’t throw an error.

The problem is purely in the way the Array equals code is written and if
changed won’t throw errors.

Z.
> 
> here is the code:
> public static boolean contains(Object obj1, Object obj2) {
> if ((obj1 == null) || (obj2 == null)) {
> //log.debug("obj1 or obj2 are null.");
> return false;
> }
> 
> if (obj1 instanceof Map) {
> if (((Map) obj1).containsKey(obj2)) {
> //log.debug("obj1 is a map and contains obj2");
> return true;
> }
> } if (obj1 instanceof Iterable) {
> Iterator iter = ((Iterable) obj1).iterator();
> while(iter.hasNext()) {
> Object value = iter.next();
> if (obj2.equals(value) || obj2.toString().equals(value)) {
> return true;
> }
> }
> } else if (obj1.getClass().isArray()) {
> for (int i = 0; i < Array.getLength(obj1); i++) {
> Object value = null;
> value = Array.get(obj1, i);
> 
> if (value.equals(obj2)) {
> //log.debug("obj1 is an array and contains obj2");
> return true;
> }
> }
> } 
> 
> //the Utility contains method will error out with
> null obj1
> null obj2
> obj1 which is not a valid Array
> obj2 which is not a valid Array
> 
> checkboxlist references required list attribute to draw from to quote
> list is a Iterable source to populate from. If the list is a Map (key, value),
> the Map key will become the option 'value' parameter and the Map value will
> become the option body.
> 
> http://struts.apache.org/2.0.14/docs/checkboxlist.html
> Martin Gainty 
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich
> dem Austausch von Informationen und entfaltet keine rechtliche
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
> interdite. Ce message sert à l'information seulement et n'aura pas n'importe
> quel effet légalement obligatoire. Étant donné que les email peuvent
> facilement être sujets à la manipulation, nous ne pouvons accepter aucune
> responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
>> > Date: Mon, 22 Jun 2009 22:14:31 +1000
>> > Subject: Freemarker error generated with CheckBox List
>> > From: zo...@sparecreative.com
>> > To: user@struts.apache.org
>> > 
>> > 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(ContainUtil.java:96)
>> > 
>> > When I had a look at the source for ContainUtil, I noticed that the equals
>> > expression is arse about.
>> > 
>> > if (obj1.getClass().isArray()) {
>> > for (int i = 0; i < Array.getLength(obj1); i++) {
>> > Object value = null;
>> > value = Array.get(obj1, i);
>> > 
>> > (Error is thrown here)  if (value.equals(obj2)) {
>> > //log.debug("obj1 is an array and contains obj2");
>> > return true;
>> > }
>> > }
>> > 
>> > Ideally the expression would be best rewritten if(obj2.equals(value))  as
>> we
>> > have already tested obj2 for nullness at the start of the contains method.
>> > 
>> > Now the hard part, I don¹t want to have to recompile the struts code and >>
was
>> > hoping there was a simple workaround.
>> > 
>> > All suggestions considered at this point.
>> > 
>> > TIA 
>> > 
>> > Z.
> 
> 
> Lauren found her dream laptop. Find the PC that’s right for you.
> 

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. 

Here is what happens:
I have an action declaration as such - 







When the action gets called, I get a blank page.  The only way this
works is if I add the "redirect=true" attribute to the  tag.
The .jsp file in this case AForm.jsp does get called as I can see the
logging I added to see if it was even hitting that .jsp.  We need it to
work without having to specify the redirect=true attribute.

I have run the examples that are packaged in the struts 1.3.10
distribution and they all run fine on our server configuration.

Does anyone have any idea as to what could be causing this error?  If I
switch jar files and change the dtd's to the older struts, the
application works ok.

Any help would be greatly appreciated.   Let me know if you need more
information than what I have given in this email.

Thanks!

Luis Esquivel


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



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
"/html/onlinepayment_portlet/user_info.jsp" not found
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

What are those funny " surrounded the path user_info.jsp file?

Thanks for the help


2009/6/22 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 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="/onlinepayment_portlet/reg"
>>>  * scope="session"
>>>  * input="/portlet/onlinepayment_portlet/reg.jsp"
>>>  *
>>>  * @struts.action-forward name="/onlinepayment_portlet/reg"
>>> path="/onlinepayment_portlet/reg.jsp"
>>>  * @struts.action-forward name="/onlinepayment_portlet/user_info"
>>> path="/onlinepayment_portlet/user_info.jsp"
>>>  */
>>>
>>> public class OrderAction extends PortletAction{
>>>
>>> /*
>>>    public ActionForward execute(ActionMapping mapping,ActionForm
>>> form, HttpServletRequest request, HttpServletResponse response) throws
>>> IOException,ServletException{
>>>        return mapping.findForward("success");
>>>    }
>>> */
>>>
>>>        public ActionForward execute(
>>>                        ActionMapping mapping, ActionForm form,
>>> HttpServletRequest req,
>>>                        HttpServletResponse res)
>>>                throws Exception {
>>>
>>>               //Get form and initialize only if number list not empty
>>>               OrderForm orderForm = (OrderForm) form;
>>>
>>>                String pw = orderForm.getPassword().trim();
>>>                String emailaddr = orderForm.getEmailAddress().trim();
>>>               if (pw.length() > 0 && emailaddr.length() > 0 ) {
>>>                  return
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>                }
>>>                else
>>>                        return
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>        }
>>>
>>>
>>>        public ActionForward render(
>>>                        ActionMapping mapping, ActionForm form,
>>> PortletConfig config,
>>>                        RenderRequest req, RenderResponse res)
>>>                throws Exception {
>>>
>>>                OrderForm orderForm = (OrderForm)form;
>>>
>>>                return 
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>        }
>>> }
>>>
>>> -- reg.jsp:
>>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>>
>>> >> property="emailAddress" type="java.lang.String" />
>>>
>>> >> focus="emailAddress">
>>>
>>> 
>>>  
>>>    >> key="form.email_address"/>
>>>  
>>>  
>>>    
>>>     
>>>    
>>>  
>>>  
>>>    
>>>
>>>    
>>>  
>>>
>>>  
>>>    Password
>>>
>>>  
>>>  
>>>    
>>>      >> class="jc_tran_input">
>>>    
>>>  
>>>  
>>>    
>>>
>>>    
>>>
>>>  
>>>  
>>>    
>>>
>>>    
>>>  
>>>  
>>>    
>>>   
>>>   
>>>      
>>>      
>>>    
>>>  
>>> 
>>>
>>> -- user_info.jsp
>>>
>>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>>
>>> >> type="java.lang.String" />
>>> >> type="java.lang.String" />
>>> >> property="shippingAddress" type="java.lang.String" />
>>> >> property="billingAddress" type="java.lang.String" />
>>>
>>> >> focus="emailAddress">
>>>
>>> 
>>>  
>>>        >> key="form.firstname"/>
>>>         >> size="50" /> 
>>>        >> key="form.lastname"/>
>>>         >> size="50" /> 
>>>  
>>>     
>>>   >> key="form.email_address"/> 
>>>    >> size="50" /> 
>>>  
>>>
>>>   Password 
>>>    >> size="50" value="" class="jc_tran_input"> 
>>>  
>>>     
>>>   
>>>   
>>>   
>>>
>>>      
>>>      
>>>      
>>>      
>>>    
>>>  
>>> 
>>>
>>> Your help is much appreciated.
>>> Thanks
>>>
>>> -
>>> 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: 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ł Wielgus.


2009/6/22 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 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="/onlinepayment_portlet/reg"
>>>  * scope="session"
>>>  * input="/portlet/onlinepayment_portlet/reg.jsp"
>>>  *
>>>  * @struts.action-forward name="/onlinepayment_portlet/reg"
>>> path="/onlinepayment_portlet/reg.jsp"
>>>  * @struts.action-forward name="/onlinepayment_portlet/user_info"
>>> path="/onlinepayment_portlet/user_info.jsp"
>>>  */
>>>
>>> public class OrderAction extends PortletAction{
>>>
>>> /*
>>>    public ActionForward execute(ActionMapping mapping,ActionForm
>>> form, HttpServletRequest request, HttpServletResponse response) throws
>>> IOException,ServletException{
>>>        return mapping.findForward("success");
>>>    }
>>> */
>>>
>>>        public ActionForward execute(
>>>                        ActionMapping mapping, ActionForm form,
>>> HttpServletRequest req,
>>>                        HttpServletResponse res)
>>>                throws Exception {
>>>
>>>               //Get form and initialize only if number list not empty
>>>               OrderForm orderForm = (OrderForm) form;
>>>
>>>                String pw = orderForm.getPassword().trim();
>>>                String emailaddr = orderForm.getEmailAddress().trim();
>>>               if (pw.length() > 0 && emailaddr.length() > 0 ) {
>>>                  return
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>                }
>>>                else
>>>                        return
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>        }
>>>
>>>
>>>        public ActionForward render(
>>>                        ActionMapping mapping, ActionForm form,
>>> PortletConfig config,
>>>                        RenderRequest req, RenderResponse res)
>>>                throws Exception {
>>>
>>>                OrderForm orderForm = (OrderForm)form;
>>>
>>>                return 
>>> mapping.findForward("/onlinepayment_portlet/user_info");
>>>        }
>>> }
>>>
>>> -- reg.jsp:
>>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>>
>>> >> property="emailAddress" type="java.lang.String" />
>>>
>>> >> focus="emailAddress">
>>>
>>> 
>>>  
>>>    >> key="form.email_address"/>
>>>  
>>>  
>>>    
>>>     
>>>    
>>>  
>>>  
>>>    
>>>
>>>    
>>>  
>>>
>>>  
>>>    Password
>>>
>>>  
>>>  
>>>    
>>>      >> class="jc_tran_input">
>>>    
>>>  
>>>  
>>>    
>>>
>>>    
>>>
>>>  
>>>  
>>>    
>>>
>>>    
>>>  
>>>  
>>>    
>>>   
>>>   
>>>      
>>>      
>>>    
>>>  
>>> 
>>>
>>> -- user_info.jsp
>>>
>>> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>>>
>>> >> type="java.lang.String" />
>>> >> type="java.lang.String" />
>>> >> property="shippingAddress" type="java.lang.String" />
>>> >> property="billingAddress" type="java.lang.String" />
>>>
>>> >> focus="emailAddress">
>>>
>>> 
>>>  
>>>        >> key="form.firstname"/>
>>>         >> size="50" /> 
>>>        >> key="form.lastname"/>
>>>         >> size="50" /> 
>>>  
>>>     
>>>   >> key="form.email_address"/> 
>>>    >> size="50" /> 
>>>  
>>>
>>>   Password 
>>>    >> size="50" value="" class="jc_tran_input"> 
>>>  
>>>     
>>>   
>>>   
>>>   
>>>
>>>      
>>>      
>>>      
>>>      
>>>    
>>>  
>>> 
>>>
>>> Your help is much appreciated.
>>> Thanks
>>>
>>> -
>>> 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
>>
>>
>
> -
> 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: 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.

Please let me know if you have any other suggestion.

Thanks!

-Original Message-
From: Girish Naik [mailto:girish.n...@gmail.com] 
Sent: Friday, June 19, 2009 10:13 PM
To: Struts Users Mailing List
Subject: Re: Struts 1.3.10 problem

May be this will bring some help:
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

But what i feel is that the app should have been upgraded to 1.2 first then
from there to 1.3 ?

Regards,
-
Girish Naik
Mobile:-+91-09740091638
girish.n...@gmail.com
George Carlin
- "Electricity is really just organized lightning."

On Sat, Jun 20, 2009 at 2:59 AM, Luis Esquivel  wrote:

> 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.
>
> Here is what happens:
> I have an action declaration as such -
>
>
>type="com.package.AClassAction"
>name="aForm"
>scope="session"
>input="/AForm.jsp"
>validate="true">
>
>
>
>
> When the action gets called, I get a blank page.  The only way this
> works is if I add the "redirect=true" attribute to the  tag.
> The .jsp file in this case AForm.jsp does get called as I can see the
> logging I added to see if it was even hitting that .jsp.  We need it to
> work without having to specify the redirect=true attribute.
>
> I have run the examples that are packaged in the struts 1.3.10
> distribution and they all run fine on our server configuration.
>
> Does anyone have any idea as to what could be causing this error?  If I
> switch jar files and change the dtd's to the older struts, the
> application works ok.
>
> Any help would be greatly appreciated.   Let me know if you need more
> information than what I have given in this email.
>
> Thanks!
>
>
> Luis Esquivel
> Application Development
> Public Employees' Retirement Assoc. of Colorado
> 1300 Logan Street
> Denver, CO 80203
> 303 - 837 - 6296
>
>


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_portlet/user_info.jsp" not found
> javax.servlet.ServletException: File
> "/html/onlinepayment_portlet/user_info.jsp" not found
>        at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)
>        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> What are those funny " surrounded the path user_info.jsp file?
>
> Thanks for the help
>
>
> 2009/6/22 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 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="/onlinepayment_portlet/reg"
  * scope="session"
  * input="/portlet/onlinepayment_portlet/reg.jsp"
  *
  * @struts.action-forward name="/onlinepayment_portlet/reg"
 path="/onlinepayment_portlet/reg.jsp"
  * @struts.action-forward name="/onlinepayment_portlet/user_info"
 path="/onlinepayment_portlet/user_info.jsp"
  */

 public class OrderAction extends PortletAction{

 /*
    public ActionForward execute(ActionMapping mapping,ActionForm
 form, HttpServletRequest request, HttpServletResponse response) throws
 IOException,ServletException{
        return mapping.findForward("success");
    }
 */

        public ActionForward execute(
                        ActionMapping mapping, ActionForm form,
 HttpServletRequest req,
                        HttpServletResponse res)
                throws Exception {

               //Get form and initialize only if number list not empty
               OrderForm orderForm = (OrderForm) form;

                String pw = orderForm.getPassword().trim();
                String emailaddr = orderForm.getEmailAddress().trim();
               if (pw.length() > 0 && emailaddr.length() > 0 ) {
                  return
 mapping.findForward("/onlinepayment_portlet/user_info");
                }
                else
                        return
 mapping.findForward("/onlinepayment_portlet/user_info");
        }


        public ActionForward render(
                        ActionMapping mapping, ActionForm form,
 PortletConfig config,
                        RenderRequest req, RenderResponse res)
                throws Exception {

                OrderForm orderForm = (OrderForm)form;

                return 
 mapping.findForward("/onlinepayment_portlet/user_info");
        }
 }

 -- reg.jsp:
 <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>

 >>> property="emailAddress" type="java.lang.String" />

 >>> focus="emailAddress">

 
  
    >>> key="form.email_address"/>
  
  
    
     
    
  
  
    

    
  

  
    Password

  
  
    
      >>> class="jc_tran_input">
    
  
  
    

    

  
  
    

    
  
  
    
   
   
      
      >>> key="button.cancel_checkout"/>
    
  
 

 -- user_info.jsp

 <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>

 >>> type="java.lang.String" />
 >>> type="java.lang.String" />
 >>> property="shippingAddress" type="java.lang.String" />
 >>> property="billingAddress" type="java.lang.String" />

 >>> focus="emailAddress">

 
  
        >>> key="form.firstname"/>
         >>> size="50" /> 
        >>> key="form.lastname"/>
         >>> size="50" /> 
  
     
   >>> key="form.email_address"/> 
    >>> size="50" /> 
  

   Password 
    >>> size="50" value="" class="jc_tran_input"> 
  
     
   
   
   

      
      
      
      >>> key="button.cancel_checkout"/>
    
  
 

 Your help is much appreciated.
 Thanks

 -
 To unsubscribe, e-mail: user-unsubscr..

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 hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Mon, 22 Jun 2009 09:42:58 -0400
> Subject: Re: redirect action in s:submit
> From: greg.lindh...@gmail.com
> To: user@struts.apache.org
> 
> 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 DefaultActionMapper.  I don't think you
> will be able to add parameters using the "redirect-action:" prefix. I
> haven't try it but you should be able to use the "redirect:" prefix and
> construct the url with parameters like this
> "redirect:MyAction.action?param1=value1¶m2=value2".

_
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

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 {
// this for determines wich radiobutton was selected
for (i=0; i < document.sectionListFrm.section.length; i++) {
   if (document.sectionListFrm.section[i].checked) {
  sectionSelected = document.sectionListFrm.section[i].value
  break;
   }
}
} catch (e) {
sectionSelected = 0;
}

   document.sectionListFrm.section.value = sectionSelected;

As you can see, you must have a hidden form field to hold the
sectionSelected radio button.

Hope this help you,

Luis Ureña,



2009/6/19 Vishnu Vyasan Nelliparmbil 

> Hi Friends,
>
> I am new to web development and struts. I have a simple question.
>
> I am using  tag to iterate through a list of Employees
> and display their details.
> The list contains the Employee objects.
> Now while displaying Employee details in a table, the row is ending with
> a check box , so that the user can select employees. The check boxes are
> created dynamically since they are inside the iterate tag.
>
> Now how in Action I know that a specific employee is selected?
>
> In action form I would get whether the check box is selected or not. But
> how can I relate that to employees in list?
>
> Thanks in Advance
> vishnu
>
>
>
>
>
>
>
>
>
>
>
>


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:

 
























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 together, following exception interrupt my
process.

Any ideas?

Exception:

org.mortbay.util.MultiException[Unable to load configuration. - [unknown
location]]
at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
at org.mortbay.util.Container.start(Container.java:72)
at
org.eclipse.wst.server.preview.internal.PreviewStarter.run(PreviewStarter.java:114)
at
org.eclipse.wst.server.preview.internal.PreviewStarter.main(PreviewStarter.java:39)
Unable to load configuration. - [unknown location]
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:310)
at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
at org.mortbay.util.Container.start(Container.java:72)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
at org.mortbay.util.Container.start(Container.java:72)
at
org.eclipse.wst.server.preview.internal.PreviewStarter.run(PreviewStarter.java:114)
at
org.eclipse.wst.server.preview.internal.PreviewStarter.main(PreviewStarter.java:39)
Caused by: Caught exception while loading file struts-default.xml -
[unknown location]
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:894)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:144)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:111)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:164)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 11 more
Caused by: java.lang.ClassCastException:
org.apache.xerces.parsers.XML11Configuration cannot be cast to
org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(Unknown
Source)
at
com.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:205)
at
com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:190)
at
com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:181)
at
com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:167)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:107)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:885)

-- 
Cand.-Ing. (FH) Christian B. Ries
Fachhochschule Bielefeld
University of Applied Sciences
FB3 /  Ingenieurwissenschaften und Mathematik

Fon: +49 (0) 521 32 73 538
Mobile:  +49 (0) 176 64 64 63 58

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



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
> @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, Martin Gainty 
> wrote:
>
>
> > > Yes it works and it's part of the DefaultActionMapper.  I don't think
> you
> > > will be able to add parameters using the "redirect-action:" prefix. I
> > > haven't try it but you should be able to use the "redirect:" prefix and
> > > construct the url with parameters like this
> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >


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, Martin Gainty  wrote:

>
> 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 hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Mon, 22 Jun 2009 09:42:58 -0400
> > Subject: Re: redirect action in s:submit
> > From: greg.lindh...@gmail.com
> > To: user@struts.apache.org
> >
> > 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 DefaultActionMapper.  I don't think you
> > will be able to add parameters using the "redirect-action:" prefix. I
> > haven't try it but you should be able to use the "redirect:" prefix and
> > construct the url with parameters like this
> > "redirect:MyAction.action?param1=value1¶m2=value2".
>
> _
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
>
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
>


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 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
>> @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, Martin Gainty 
>> wrote:
>>
>>
>> > > Yes it works and it's part of the DefaultActionMapper.  I don't think
>> you
>> > > will be able to add parameters using the "redirect-action:" prefix. I
>> > > haven't try it but you should be able to use the "redirect:" prefix and
>> > > construct the url with parameters like this
>> > > "redirect:MyAction.action?param1=value1¶m2=value2".
>> >
>



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



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...@ku.edu
University of Kansas - IT


-Original Message-
From: Greg Lindholm [mailto:greg.lindh...@gmail.com] 
Sent: Monday, June 22, 2009 10:04 AM
To: Struts Users Mailing List
Subject: Re: redirect action in s:submit

>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
> @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, Martin Gainty 
> wrote:
>
>
> > > Yes it works and it's part of the DefaultActionMapper.  I don't
think
> you
> > > will be able to add parameters using the "redirect-action:"
prefix. I
> > > haven't try it but you should be able to use the "redirect:"
prefix and
> > > construct the url with parameters like this
> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >

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



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, 2009 at 1:04 AM, Greg Lindholm wrote:
> 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
>> @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, Martin Gainty 
>> wrote:
>>
>>
>> > > Yes it works and it's part of the DefaultActionMapper.  I don't think
>> you
>> > > will be able to add parameters using the "redirect-action:" prefix. I
>> > > haven't try it but you should be able to use the "redirect:" prefix and
>> > > construct the url with parameters like this
>> > > "redirect:MyAction.action?param1=value1¶m2=value2".
>> >
>

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



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


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

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



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 AM, 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
> directly in a jsp without modification in action or something like
> that?
> thanks
> --
> Stefano
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


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
> directly in a jsp without modification in action or something like
> that?
> thanks
> --
> Stefano
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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, especially
> since this is a pretty general problem.
> jk
>
> On Mon, Jun 22, 2009 at 11:37 AM, 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
> > directly in a jsp without modification in action or something like
> > that?
> > thanks
> > --
> > Stefano
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>



-- 
Stefano


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: Monday, June 22, 2009 11:42 AM
> To: Struts Users Mailing List
> Subject: Re: Display only 100 chars of a string
> 
> 
> 
> 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
> > directly in a jsp without modification in action or something like
> > that?
> > thanks
> > --
> > Stefano
> >
> > 
> -
> > 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: 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 answer this question in a manner that would be helpful.
If you have never debugged a Struts 2 application then it's not like likely
anything I say can help you.

Better answer the 3 questions above and see if that reveals anything useful.


On Mon, Jun 22, 2009 at 11:21 AM, Sam Wun  wrote:

> 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, 2009 at 1:04 AM, Greg Lindholm
> wrote:
> > 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
> >> @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, Martin Gainty 
> >> wrote:
> >>
> >>
> >> > > Yes it works and it's part of the DefaultActionMapper.  I don't
> think
> >> you
> >> > > will be able to add parameters using the "redirect-action:" prefix.
> I
> >> > > haven't try it but you should be able to use the "redirect:" prefix
> and
> >> > > construct the url with parameters like this
> >> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >> >
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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-h...@struts.apache.org



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 abbreviate
 * @param len the maximum length of the returned string (must be greater
 *then 3)
 * @return the string abbreviated with ellipses to a maximum length of
 * len
 */
public String abbreviate(String text, int len)
{
return org.apache.commons.lang.StringUtils.abbreviate(text, len);
}

Then in the JSP I can use it like this 


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
> Subject: Re: Display only 100 chars of a string
> 
> 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-h...@struts.apache.org
> 
> 

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



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'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: Re: Display only 100 chars of a string
>>
>> @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:
>> > > 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: Monday, June 22, 2009 11:58 AM
>> >> To: Struts Users Mailing List
>> >> Subject: Re: Display only 100 chars of a string
>> >>
>> >> 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-h...@struts.apache.org
>> >>
>> >>
>> >
>> >
>> -
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Stefano
>>
>> -
>> 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
>
>



-- 
Stefano

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



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 request has passed through its servlet filter, which initializes the
Struts dispatcher needed for this tag. - [unknown location]

I can't find anything in my server error log files.  Below is my web.xml and
struts.xml files.  Any ideas how I can troubleshoot this?  Thanks, - Dave

===Begin 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/web-app_2_4.xsd";
version="2.4">


TransactionFilter

com.myco.regui.servlets.filters.TransactionFilter


TransactionFilter
/*

  

struts-filter


org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter



stuts-filter
/*



65



index.html


 

End web.xml ==

===Begin struts.xml =

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


























jsp/pcredirect.jsp
jsp/pcAccountLookupError.jsp



jsp/hhredirect.jsp
jsp/hhError.jsp



jsp/pcAccountLookup.jsp




End struts.xml==
-- 
View this message in context: 
http://www.nabble.com/struts-2The-Struts-dispatcher-cannot-be-found.-This-is-usually-caused-by-using-Struts-tags-without-the-associated-filter.-tp24150745p24150745.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



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...@format('%.100s', description)" />
>

In his example, the stack is searched for a property called
'description', in the new version of the tag, you probably have to
explicitly tell OGNL where to find 'description'. Try the following -



(I think it's #top, but I could be wrong, perhaps one of the OGNL
gurus can chime in).

-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



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 would also be an easy extension later if you decided that you wanted
truncated strings to end with elipses:

public String formatString(String s, int maxLen) {
  if (s.length() < maxLen) {
return s;
  } else {
return s.substring(0, maxLen - 3) + "...";
  }
}


> -Original Message-
> From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] 
> Sent: Monday, June 22, 2009 12:27 PM
> To: Struts Users Mailing List
> Subject: Re: Display only 100 chars of a string
> 
> 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...@format('%.100s', description)" />
> 
> On Mon, Jun 22, 2009 at 18:09, Jon 
> Pearson wrote:
> > 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: Re: Display only 100 chars of a string
> >>
> >> @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:
> >> >  >> 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: Monday, June 22, 2009 11:58 AM
> >> >> To: Struts Users Mailing List
> >> >> Subject: Re: Display only 100 chars of a string
> >> >>
> >> >> 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-h...@struts.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> 
> -
> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> > For additional commands, e-mail: user-h...@struts.apache.org
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Stefano
> >>
> >> 
> -
> >> 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
> >
> >
> 
> 
> 
> -- 
> Stefano
> 
> -
> 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: 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.accounts.AccountsAction.execute(), you will see
one of the JSPs you mapped as results.

Also, is there any reason why you are changing the interceptor stack?
You don't have validation and workflow, which seems a bit odd...

-Wes

On Mon, Jun 22, 2009 at 12:27 PM, laredotornado wrote:
>
> 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 request has passed through its servlet filter, which initializes the
> Struts dispatcher needed for this tag. - [unknown location]
>
> I can't find anything in my server error log files.  Below is my web.xml and
> struts.xml files.  Any ideas how I can troubleshoot this?  Thanks, - Dave
>
> ===Begin 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/web-app_2_4.xsd";
> version="2.4">
>
>    
>                TransactionFilter
>
> com.myco.regui.servlets.filters.TransactionFilter
>    
>        
>                TransactionFilter
>                /*
>        
>
>        
>                struts-filter
>                
>                        
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>                
>        
>        
>                stuts-filter
>                /*
>        
>
> 
>        65
> 
>
> 
>        index.html
> 
>
>
> 
> End web.xml ==
>
> ===Begin struts.xml =
> 
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
> 
>
>    
>    
>
>    
>
>    
>
>                
>                         class="com.myco.regui.struts.accounts.AccountsInterceptor">
>                        
>                                
>                                
>                                
>                                
>                                
>                                
>                                 name="SimpleInterceptor">
>                        
>                
>                 name="AccountsInterceptorStack">
>
>        
>         class="com.myco.regui.struts.accounts.AccountsAction">
>                jsp/pcredirect.jsp
>                jsp/pcAccountLookupError.jsp
>        
>
>                 class="com.myco.regui.struts.accounts.AccountsAction">
>                jsp/hhredirect.jsp
>                jsp/hhError.jsp
>        
>
>         class="com.myco.regui.struts.logout.LogoutAction">
>                jsp/pcAccountLookup.jsp
>        
>    
>
> 
> End struts.xml==
> --
> View this message in context: 
> http://www.nabble.com/struts-2The-Struts-dispatcher-cannot-be-found.-This-is-usually-caused-by-using-Struts-tags-without-the-associated-filter.-tp24150745p24150745.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
>
>



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



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 maxLen) {
>  return String.format("%." + maxLen + "s", s);
> }
>
> It would also be an easy extension later if you decided that you wanted
> truncated strings to end with elipses:
>
> public String formatString(String s, int maxLen) {
>  if (s.length() < maxLen) {
>    return s;
>  } else {
>    return s.substring(0, maxLen - 3) + "...";
>  }
> }
>
>

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). I think the OP mentioned at one point that adding this
to the action is not an option.

Also, another choice is to use JavaScript. Is the choice to abbreviate
because of bandwidth or screen real estate?

-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



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 (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
>> Subject: Re: Display only 100 chars of a string
>>
>> 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-h...@struts.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Stefano

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



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 (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
>> Subject: Re: Display only 100 chars of a string
>>
>> 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-h...@struts.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Stefano

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



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: Re: Display only 100 chars of a string
> 
> @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:
> >  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: Monday, June 22, 2009 11:58 AM
> >> To: Struts Users Mailing List
> >> Subject: Re: Display only 100 chars of a string
> >>
> >> 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-h...@struts.apache.org
> >>
> >>
> >
> > 
> -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
> 
> 
> 
> -- 
> Stefano
> 
> -
> 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



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.action;jsessionid=950ab20c231e4328542b8cea4abdad048c34c129d158?employee.employeeId=1


But employee or employee.employeeId is null.

Any help is appreciated.

regards,
Jill.


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.


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 called
"AccountsInterceptor".  What is the proper way?  All the tutorials suggest
you have to create a custom interceptor stack.

Thanks, - Dave





Wes Wannemacher wrote:
> 
> 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.accounts.AccountsAction.execute(), you will see
> one of the JSPs you mapped as results.
> 
> Also, is there any reason why you are changing the interceptor stack?
> You don't have validation and workflow, which seems a bit odd...
> 
> -Wes
> 
> On Mon, Jun 22, 2009 at 12:27 PM, laredotornado
> wrote:
>>
>> 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 request has passed through its servlet filter, which initializes the
>> Struts dispatcher needed for this tag. - [unknown location]
>>
>> I can't find anything in my server error log files.  Below is my web.xml
>> and
>> struts.xml files.  Any ideas how I can troubleshoot this?  Thanks, - Dave
>>
>> ===Begin 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/web-app_2_4.xsd";
>> version="2.4">
>>
>>    
>>                TransactionFilter
>>
>> com.myco.regui.servlets.filters.TransactionFilter
>>    
>>        
>>                TransactionFilter
>>                /*
>>        
>>
>>        
>>                struts-filter
>>                
>>                      
>>  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>>                
>>        
>>        
>>                stuts-filter
>>                /*
>>        
>>
>> 
>>        65
>> 
>>
>> 
>>        index.html
>> 
>>
>>
>> 
>> End web.xml ==
>>
>> ===Begin struts.xml =
>> 
>> >    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>    "http://struts.apache.org/dtds/struts-2.0.dtd";>
>>
>> 
>>
>>    > />
>>    
>>
>>    
>>
>>    
>>
>>                
>>                        > class="com.myco.regui.struts.accounts.AccountsInterceptor">
>>                        > name="AccountsInterceptorStack">
>>                                
>>                                
>>                                
>>                                
>>                                
>>                                
>>                                > name="SimpleInterceptor">
>>                        
>>                
>>                > name="AccountsInterceptorStack">
>>
>>        
>>        > class="com.myco.regui.struts.accounts.AccountsAction">
>>                jsp/pcredirect.jsp
>>                > name="failure">jsp/pcAccountLookupError.jsp
>>        
>>
>>                > class="com.myco.regui.struts.accounts.AccountsAction">
>>                jsp/hhredirect.jsp
>>                jsp/hhError.jsp
>>        
>>
>>        > class="com.myco.regui.struts.logout.LogoutAction">
>>                jsp/pcAccountLookup.jsp
>>        
>>    
>>
>> 
>> End struts.xml==
>> --
>> View this message in context:
>> http://www.nabble.com/struts-2The-Struts-dispatcher-cannot-be-found.-This-is-usually-caused-by-using-Struts-tags-without-the-associated-filter.-tp24150745p24150745.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
>>
>>
> 
> 
> 
> -- 
> 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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/struts-2The-Struts-dispatcher-cannot-be-found.-This-is-usually-caused-by-using-Struts-tags-without-the-associated-filter.-tp24150745p24151677.html
Sent from th

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 1:03 PM, jill juneja  wrote:

> 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.action;jsessionid=950ab20c231e4328542b8cea4abdad048c34c129d158?employee.employeeId=1
>
>
> But employee or employee.employeeId is null.
>
> Any help is appreciated.
>
> regards,
> Jill.
>


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 explain what is
happening. For example, when I search for something let say EmpId. I
retrieve the correct data. But when the action post back the data the
results look OK. But always happens something interesting I don't know what
it is the reason. The form that was in the search.jsp are being populate by
the first result retrieve from the database. I already overwrote the reset
method. I try a lot things but no luck. Another thing that it is weird is
that no all fields are being populate. As I told you are six text fields.
Only four on the are being populate in session. Please if anybody have
previously had this problem before. I really appreciate any help. Because
this thing is driving me crazy. Thank in advance to anybody who help me. 
-- 
View this message in context: 
http://www.nabble.com/Problem-resetting-the-formBean.-tp24152700p24152700.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



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 Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> From: stefano.tranquill...@gmail.com
> Date: Mon, 22 Jun 2009 18:26:45 +0200
> Subject: Re: Display only 100 chars of a string
> To: user@struts.apache.org
> 
> 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...@format('%.100s', description)" />
> 
> On Mon, Jun 22, 2009 at 18:09, Jon Pearson wrote:
> > 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: Re: Display only 100 chars of a string
> >>
> >> @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:
> >> >  >> 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: Monday, June 22, 2009 11:58 AM
> >> >> To: Struts Users Mailing List
> >> >> Subject: Re: Display only 100 chars of a string
> >> >>
> >> >> 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-h...@struts.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> -
> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> > For additional commands, e-mail: user-h...@struts.apache.org
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Stefano
> >>
> >> -
> >> 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
> >
> >
> 
> 
> 
> -- 
> Stefano
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Microsoft brings you a new way to search the web.  Try  Bing™ now
http://www.bing.com?form=MFEHPG&publ=WLHMTAG&crea=TEXT_MFEHPG_Core_tagline_try 
bing_1x1

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

Johnson nickel wrote:


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 particular package only.Because i need to execute
the action file
// index.action
public String execute() throws Exception{

request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("fr","FR"));

}


using this each time i need to execute the action file. can i add for
multiple 
language file??( like this code)


request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("fr","FR"));
request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, new
java.util.Locale("en","US"));

-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 11:28

To: user@struts.apache.org
Subject: RE: Localization in struts 2


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





-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: 22 June 2009 09:58

To: user@struts.apache.org
Subject: RE: Localization in struts 2



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

struts.custom.i18n.resources=com.kogent.ResourceBundle 
struts.custom.i18n.resources=com.company.model
struts.custom.i18n.resources=com.company.pojo 

And one more thing,for ex, If user select hindi 
index.action?request_locale=hi Hindi 


i need to change all hindi text in throughout my application all the jsp
pages. 
Can you  give me suggestion




 


Muthu Velappan wrote:

I think if an app has to support internationalization then all text
should
be written from properties file and not through static images content.
So,
I
would be remove images and try to get write all text from properties file
only.
 
For Dynamic Data Issue - I believe you fetch the content from database.

If
you want to show them also in hindi then you should maintain that in db
as
well. For example: you want show all countries in English as well hindi. 


Then your countries table should be like this

Countryid   namename_hi
name_fr 
1		India	 
content>
2   UK   -do-   -do-
3   USA  -do-   -do-
and so no...

While fetching you have to pass the ISO language code along with request
and
fetch data from respective column. This is one way of solving your issue.
I
don’t know how much of dynamic content you want to show like this. If you
have a very huge list then this would be a very difficult job to
complete.

Regards,
Muthu

-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: Thursday, June 18, 2009 1:15 PM

To: user@struts.apache.org
Subject: RE: Localization in struts 2



Thank you.. it's working fine. I have other issue.. in my application
most 
of the places i used the images. I want to change images(like
username,password) also in hindi. 


And, using this method, i can display the text from properties file only.
in
my application
i have some dynamic data to add some data..for that i need to display in
hindi only..

Can you me a suggestions it will be helpful for further work. I 'm using
struts 2 framework.


Muthu Velappan wrote:

Try this...

Take a copy of ur current properties file and name it as
hinditext.txt(save
it in UTF-8 format)

Now open command prompt and go to your /bin folder and run
this
command 


native2ascii -encoding UTF-8 


Now rename this app_hi.properties file with respect to ur application
properties file and copy to the required place. Restart the server you
should be able to see the hindi text properly in browser.

Hope this solves your problem.

Thanks,
Muthu

-Original Message-
From: Johnson nickel [mailto:sarava...@elogic.co.in] 
Sent: Thursday, June 18,

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 configuration that causes the error.

Dave

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



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 also my response on JavaRanch--it's best if you mention on JavaRanch 
as per their FAQ when you're cross-posting similar questions.


I don't know of any tutorials that recommend creating a new interceptor 
or interceptor stack for doing custom validations--most say to create a 
custom validator.


Dave

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



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 designer (which is 
usually us) or a design-driven process.


That said, if it's a site-wide thing--where does it belong? Maybe a 
custom tag, which is kind of a compromise: the OGNL treachery is 
localized (if done in OGNL), or the scriptlet, or a utility call into 
the app, etc.


If I was doing it myself I'd probably just "cheat", or create a 
JSP-based custom tag that wrapped it up and hid it away.


Dave

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



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 static
content with paths relative to two different roots.

--Config--

 
   


  /css/{1}.css

 
  
  



  /css/admin/{1}.css

  


--Uses--








-- 
View this message in context: 
http://www.nabble.com/Struts2-static-content-tp19784601p24156484.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



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 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 static
> content with paths relative to two different roots.
>
> --Config--
> 
>  
>   
>
>    
>      /css/{1}.css
>    
>  
>
>  
>    
>
>    
>      /css/admin/{1}.css
>    
>  
> 
>
> --Uses--
> 
>
> 
> 
>
> 
> 
>
> --
> View this message in context: 
> http://www.nabble.com/Struts2-static-content-tp19784601p24156484.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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



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 subclass

* use a global exception mapping to map the NotLoggedInException
  to a suitable login action

I can't seem to get this to work, I get a 500 response with a stack
trace, saying "Unable to instantiate Action". If I arrange for the
constructor to complete without an exception and for the execute()
method to throw a NotLoggedInException, I get to the login action as
I intend.

So it seems that only exceptions thrown by execute(), but not those
thrown by constructors, are handled as specified by the exception
mappings (at least the global ones) -- is that right? And if so, why
is that?

Or do you thing I've just made some silly mistake here?

Best regards, Jan
-- 
 +- Jan T. Kim ---+
 | email: j@uea.ac.uk |
 | WWW:   http://www.cmp.uea.ac.uk/people/jtk |
 *-=<  hierarchical systems are for files, not for humans  >=-*

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



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 Message-
From: Girish Naik [mailto:girish.n...@gmail.com] 
Sent: Friday, June 19, 2009 8:19 PM
To: Struts Users Mailing List
Subject: Re: how to prevent users from directly accessing jsp files

But in that case the css, images, js is compromised rite?
What if I want all to be secured?


Regards,
-
Girish Naik
Mobile:-+91-09740091638
girish.n...@gmail.com
Fran Lebowitz
- "Life is something to do when you can't get to sleep."

On Fri, Jun 19, 2009 at 7:15 PM, Greg Lindholm wrote:

> >  I tried  putting the below string in web.xml, but all my css, js from
> the
> > application got blocked. But pages are coming. Is something missing or
> some
> > extra thing to be done?
> >
> > 
> >Prevent access to raw pages.
> >
> >Raw Pages
> >/struts/*
> >
> >
> >No roles, so no direct access
> >
> >
> >
> >
> >
> > Regards,
> > -
> > Girish Naik
> >
>
> The way this security constraint works is it prevents direct access to the
> area defined
> by the /struts/* elements (you can have
> multiple). In this case
> we put our jsp files under /struts/ folder.
>
> You can name the folder whatever you like but only put jsp files in it.
>  You
> need to put
> your css and js file someplace else.
>
> Our typical layout for webroot is:
> /
>  css/
>  images/
>  js/
>  struts/
>  WEB-INF/
>

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



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 without using spring at all,
but as suggested if we can use it by including only some libraries than this
is not a bad choice at all.

Thanks Dustin for detailed explanation, we are surely going to dig in to
this frame work.

On Mon, Jun 22, 2009 at 3:38 PM, Dave Newton  wrote:

> 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
>
>
> -
> 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 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 action");

request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY,
new java.util.Locale("fr","FR"));
System.out.println(request.getSession());
return SUCCESS;
}

So, Whenever user select the language , it will execute the action it will
read the corresponding 
properties file. I'm facing the problem ,each time i need to return separate
jsp.

In struts.xml file,

 /index.jsp
   

Here, i don't want to return the jsp file.

 


newton.dave wrote:
> 
> 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
> 
> Johnson nickel wrote:
>> 
>> 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 particular package only.Because i need to
>> execute
>> the action file
>> // index.action
>> public String execute() throws Exception{
>>  
>> request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY,
>> new
>> java.util.Locale("fr","FR"));
>> 
>> }
>> 
>> 
>> using this each time i need to execute the action file. can i add for
>> multiple 
>> language file??( like this code)
>> 
>> request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY,
>> new
>> java.util.Locale("fr","FR"));
>> request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY,
>> new
>> java.util.Locale("en","US"));
>> 
>> -Original Message-
>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>> Sent: 22 June 2009 11:28
>> To: user@struts.apache.org
>> Subject: RE: Localization in struts 2
>> 
>> 
>> 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 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.
>>>
>>>
>>>
>>>
>>>
>>> -Original Message-
>>> From: Johnson nickel [mailto:sarava...@elogic.co.in] 
>>> Sent: 22 June 2009 09:58
>>> To: user@struts.apache.org
>>> Subject: RE: Localization in struts 2
>>>
>>>
>>>
>>> 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
>>>
>>> struts.custom.i18n.resources=com.kogent.ResourceBundle 
>>> struts.custom.i18n.resources=com.company.model
>>> struts.custom.i18n.resources=com.company.pojo 
>>>
>>> And one more thing,for ex, If user select hindi 
>>> index.action?request_locale=hi Hindi 
>>>
>>> i need to change all hindi text in throughout my application all the jsp
>>> pages. 
>>> Can you  give me suggestion
>>>
>>>
>>>
>>>  
>>>
>>> Muthu Velappan wrote:
 I think if an app has to support internationalization then all text
 should
 be written from properties file and not through static images content.
 So,
 I
 would be remove images and try to get write all text from properties
 file
 only.
  
 For Dynamic Data Issue - I believe you fetch the content from database.
 If
 you want to show them also in hindi then you should maintain that in db
 as
 well. For example: you want show all countries in English as well
 hindi. 

 Then your countries table should be like this

 Countryid  namename_hi
 name_fr 
 1  India>>> content>
 2  UK   -do-   -do-
 3  USA  -do-   -do-
 and so no...

 While fetching you have to pass the ISO language code along with
 request
 and
 fetch data from respective column. This is one way of solving your
 issue.
 I
 don’t know how much of dynamic content you want to show like this. If
 yo