RE: Localization in struts 2

2009-06-21 Thread Johnson nickel


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

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 this message in context:
 http://www.nabble.com/Localization-in-struts-2-tp24086510p24086510.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


>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://www

Re: basic question about

2009-06-21 Thread dusty

Perhaps the language is bad, but what I believe that documentation means is
that when you are iterating the each object in the iteration is at the top
of the stack so that when you do something like this:





Struts knows that you mean #session.users[i].firstName.  It knows that based
on how the value stack works.  


Here is a quote from an infoq.com article describing the Value Stack:

http://www.infoq.com/articles/migrating-struts-2-part3 wrote:
> 
>  Instead of different scopes that the JSP developer needs to explicitly
> specify, Struts2 has a Value Stack. The Value Stack is just an order of
> different scopes that is traversed when looking for a value. When looking
> for a value, if a getter for the field is not found in one scope, the next
> scope is checked - this continues until either the field is found or all
> the scopes have been exhausted. The order of the scopes is:
> 
>1. Temporary Objects - these are objects that are created in the JSP
> page (we will see an example soon with the s:url tag), or they are objects
> created by tags that have short lives (such as the current object during a
> loop over a collection).
>2. The Model Object - if model objects are being used, they are checked
> next (before the action).
>3. The Action Object - this is the action that has just been executed.
> Hence, without explicitly placing the action in a session or request
> scope, you will still have access to its data.
>4. Named Objects - these objects include #application, #session,
> #request, #attr and #parameters and refer to the corresponding servlet
> scopes.
> 
> The advantage is clear - each scope, in turn, is checked for the field
> that you are after. However, if you have both a model object and action
> with the same field name (set's say "id"), then problems can occur. If you
> want the models value the correct result will be returned - but if you
> want the actions value, you will be returned the models value, as the
> model scope precedes the action scope. The solution is to provide a
> qualifier determining where in the stack you want to retrieve the "id"
> field - in this example "[1].id" would retrieve the value from the action.
> More information can be found online at
> http://cwiki.apache.org/WW/ognl-basics.html.
> 

So now you realize that instead of #session.users to get to your list you
can just use users and it will search until it finds the "users" list in
your session.

  

jo_atman wrote:
> 
> Sorry if this is too basic, but i seem to be missing something.
> The iterator tag documentation says it iterates over the value on top of
> the stack. 
> I don't understand what this stack is and what is at the top of the stack.
> 
> Can i use the iterator tag to iterate over an object stored as a session
> attribute?
> 
> Any help much appreciated!
> 

-- 
View this message in context: 
http://www.nabble.com/basic-question-about-%3Cs%3Aiterator%3E-tp24141202p24141965.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: drop down list not working after using validation.xml

2009-06-21 Thread Yanto
Hi,

After used prepare the method we could see the dropdown values. But
s:fielderror tag still displaying error messages even I selected the value
from the dropdown. So that its not invoking my action class. Because
assuming still one more selection not happened in the form. Why this
behavior ?  Any other way to handle this?


   
   Please select the Entity














Regards
Yanto

On Fri, Jun 19, 2009 at 11:33 PM, Yanto  wrote:

> Hi Greg,
> thanks for the link...seem this faq entry explain the problem that we face
> now...will try it...
>
> Thanks
> Yanto
>
>
> On Fri, Jun 19, 2009 at 11:15 PM, Greg Lindholm 
> wrote:
>
>> Did you look at this FAQ entry?
>>
>>
>> http://struts.apache.org/2.1.6/docs/how-do-we-repopulate-controls-when-validation-fails.html
>>
>>
>> On Fri, Jun 19, 2009 at 10:43 AM, Girish Naik 
>> wrote:
>>
>> > One of my colleague had done it in some project. But dont know if its
>> the
>> > correct way. :(
>> >
>> >
>> > Regards,
>> > -
>> > Girish Naik
>> > Mobile:-+91-09740091638
>> > girish.n...@gmail.com
>> > Samuel Goldwyn<
>> > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
>> > - "I'm willing to admit that I may not always be right, but I am never
>> > wrong."
>> >
>> > On Fri, Jun 19, 2009 at 5:24 PM, Yanto  wrote:
>> >
>> > > Hi Girish,
>> > >
>> > > Is this mean we can load the list again in Action's Preparable method
>> ?
>> > > currently, we are trying looking at the sample in internet.
>> > >
>> > > Thanks & Regards
>> > > Yanto
>> > >
>> > > On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik 
>> > > wrote:
>> > >
>> > > > After validation, Action's Preparable method is called, you can load
>> > the
>> > > > required list in request again.
>> > > >
>> > > >
>> > > > Regards,
>> > > > -
>> > > > Girish Naik
>> > > > Mobile:-+91-09740091638
>> > > > girish.n...@gmail.com
>> > > > Samuel Goldwyn<
>> > > > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
>> > > > - "I'm willing to admit that I may not always be right, but I am
>> never
>> > > > wrong."
>> > > >
>> > > > On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton > >
>> > > > wrote:
>> > > >
>> > > > > Please consider copying your code snippets into a plain-text
>> editor
>> > > > before
>> > > > > including them in an email message: we're getting a blank line
>> > between
>> > > > each
>> > > > > line and a lot of spurious asterisks.
>> > > > >
>> > > > > Yanto wrote:
>> > > > >
>> > > > >> *org.apache.jasper.JasperException: tag 'select', field 'list',
>> name
>> > > > >> 'entityInternalId': The requested list key 'entities' could not
>> be
>> > > > >> resolved
>> > > > >> as a collection/array/map/enumeration/iterator type. Example:
>> people
>> > > or
>> > > > >> people.{name} - [unknown location]*
>> > > > >>
>> > > > >>  without validation xml and application page showing dropdown
>> coming
>> > > > >> properly.
>> > > > >>
>> > > > >>  > > > > >>name=*"entityInternalId"*
>> > > > >>list=*"entities"*
>> > > > >>headerKey=*""*
>> > > > >>headerValue=*""*
>> > > > >>listKey=*"internalId"*
>> > > > >>listValue=*"entityName"*
>> > > > >> />
>> > > > >>
>> > > > >> Any one help on this ?
>> > > > >>
>> > > > >
>> > > > > Do you load the "entities" list? Recall that actions are
>> instantiated
>> > > > > per-request.
>> > > > >
>> > > > > Dave
>> > > > >
>> > > > >
>> -
>> > > > > 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-21 Thread dusty

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.



omnipresent wrote:
> 
> I have a button value like this
> 
> 
> 
> but I want to add some parameters along with this...is that possible to do
> in the code above or do I have to make additions to struts.xml for this?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/redirect-action-in-s%3Asubmit-tp24141831p24141895.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



redirect action in s:submit

2009-06-21 Thread Bhaarat Sharma
I have a button value like this



but I want to add some parameters along with this...is that possible to do
in the code above or do I have to make additions to struts.xml for this?


Re: Struts2 and Security

2009-06-21 Thread dusty

Although Spring Security may have some dependencies on the Spring Framework,
the inclusion of those libraries should not affect the rest of your
application if you do not intend to use Spring for Dependency Injection,
etc.   In fact, the only trouble would be if you did use Spring and had some
requirement for an older version that Spring Security doesn't support.

Spring Security is implemented through a HTTP filter so it runs outside of
your S2 application and wraps the requests.  You can make static calls to
SecurityContext inside your struts actions to find out information about the
currently logged in user.  Often, people will wrap these types of calls in a
facade to insulate their application from any Spring-type
imports/dependencies in case they wanted to change security providers in the
future.

-D


aum strut wrote:
> 
> Hi All,
> 
> 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??
> 
> hope to get some light over this.
> 
> On Sun, Jun 21, 2009 at 12:37 PM, dusty  wrote:
> 
>>
>> We have used Spring Security in the last 10 struts2 apps.  We have some
>> that
>> use a local user store in the database, others that use LDAP to AD and
>> some
>> that use Atlassian's Crowd.
>>
>> Spring Security is very easy to add to your app and gives just about
>> everything you need I have not ventured into some of the more
>> advanced
>> ACL features for securing individual objects, but it is also fairly
>> straight
>> forward to provide method level security.
>>
>> A good example of Spring Security implemented on top of Struts2 is the
>> appfuse framework.  http://appfuse.org.
>>
>>
>>
>>
>> aum strut wrote:
>> >
>> > Hi All,
>> >
>> > We are on the way to develop a new application using struts2. Currently
>> we
>> > are analysing the area of authentication and authorization, we do have
>> > some
>> > options of using the following frame work for these
>> >
>> > 1) Acegi
>> > 2)JAAS
>> >
>> > my point is that we any one in the list is using any of the security
>> frame
>> > work.please let me know about there experiences, so that it will help
>> us
>> > in
>> > choosing the right security model.
>> >
>> > regarding the pltfrom we have decided to use is as follows
>> >
>> > 1) Struts2
>> > 2) JSP/Velocity
>> > 3) Hibernate
>> > 4) YUI
>> >
>> > these are the core building block rest technologies and frame work can
>> be
>> > choosen as required
>> >
>> > looking forward for your valuable suggestions.
>> >
>> > thannks in advance
>> > aum
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Struts2-and-Security-tp24106660p24132071.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
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts2-and-Security-tp24106660p24141796.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: s:select with multiple

2009-06-21 Thread Bhaarat Sharma
My mistake.   Yeah, I knew it was against the convention so I have modified
the code to take care of this.
Thanks

On Sun, Jun 21, 2009 at 8:01 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> 
>>  Reason1*
>>  Reason2*
>>  Reason3*
>>  Reason4
>>
> > 
>
>>
>> When I submit this form I am getting the values like 1 2 3 4 back to my
>> action class just fine.   What if I want to get the content of the options
>> also? meaning what If I want to get back Reason1*, reason2* etc back to my
>> action class also?
>>
>
> *Also*?
>
> That's not really how select tags work. You'd have to build the value
> manually and pull it apart again on the server side. I can't think of any
> reasons why you'd want to do that, though--what, exactly, are you trying to
> accomplish?
>
> Dave
>
> -
> 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-21 Thread aum strut
Hi All,

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

hope to get some light over this.

On Sun, Jun 21, 2009 at 12:37 PM, dusty  wrote:

>
> We have used Spring Security in the last 10 struts2 apps.  We have some
> that
> use a local user store in the database, others that use LDAP to AD and some
> that use Atlassian's Crowd.
>
> Spring Security is very easy to add to your app and gives just about
> everything you need I have not ventured into some of the more advanced
> ACL features for securing individual objects, but it is also fairly
> straight
> forward to provide method level security.
>
> A good example of Spring Security implemented on top of Struts2 is the
> appfuse framework.  http://appfuse.org.
>
>
>
>
> aum strut wrote:
> >
> > Hi All,
> >
> > We are on the way to develop a new application using struts2. Currently
> we
> > are analysing the area of authentication and authorization, we do have
> > some
> > options of using the following frame work for these
> >
> > 1) Acegi
> > 2)JAAS
> >
> > my point is that we any one in the list is using any of the security
> frame
> > work.please let me know about there experiences, so that it will help us
> > in
> > choosing the right security model.
> >
> > regarding the pltfrom we have decided to use is as follows
> >
> > 1) Struts2
> > 2) JSP/Velocity
> > 3) Hibernate
> > 4) YUI
> >
> > these are the core building block rest technologies and frame work can be
> > choosen as required
> >
> > looking forward for your valuable suggestions.
> >
> > thannks in advance
> > aum
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Struts2-and-Security-tp24106660p24132071.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: RequestProcessor and contentType response header

2009-06-21 Thread Avlesh Singh
>
> I would recomend upgrading to a later version of struts
>
Oh Mike, I wish I could do that! :)

For the problem at hand, I am better off sub-classing the RequestProcessor.
Having said that, would still try and upgrade asap.

Cheers
Avlesh

On Mon, Jun 22, 2009 at 9:30 AM, Mike Dave  wrote:

> >
> > Sounds counter-intuitive. Why should the RequestProcessor overwrite?
> >
> I am in agreement with you, Avlesh. This behaviour is erratic.
> I would recomend upgrading to a later version of struts assuming that the
> behaviour has been fixed.
>
> -m-
>
> On Sun, Jun 21, 2009 at 8:46 PM, Avlesh Singh  wrote:
> >
> >> It's also the weekend.
> >>
> >> I truly respect that.
> >>
> >> It's not a bug, that's just how it works.
> >>>
> >> Sounds counter-intuitive. Why should the RequestProcessor overwrite?
> >>
> >> Overriding the request processor is the normal way to add behavior to
> apps
> >>> running that version of Struts.
> >>>
> >> Thanks for approving the solution.
> >>
> >> Thanks again, Dave.
> >>
> >> Cheers
> >> Avlesh
> >>
> >>
> >> On Sun, Jun 21, 2009 at 5:59 PM, Dave Newton  >wrote:
> >>
> >>> Avlesh Singh wrote:
> >>>
>  Did not get a response yet :(
> 
> >>>
> >>> It's also the weekend.
> >>>
> >>>  Is this a dev list question
> 
> >>>
> >>> No.
> >>>
> >>>1. Shouldn't this method also check if the response already has a
> >   contentType header applied or not? Is this a known bug, or am I
> > missing
> >   something?
> >
> 
> >>> It's not a bug, that's just how it works.
> >>>
> >>>2. I subclassed the RequestProcessor and defined a controller in my
> >   struts config as  > processorClass="com.me.MyRequestProcessor"/>.
> >   The class merely overrides the processContent method to check for
> an
> >   existing contentType. Am I doing it correctly, or is there some
> other
> > way to
> >   achieve the desired behavour in my case.
> >
> 
> >>> Overriding the request processor is the normal way to add behavior to
> >>> apps running that version of Struts.
> >>>
> >>> Dave
> >>>
> >>> -
> >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >>> For additional commands, e-mail: user-h...@struts.apache.org
> >>>
> >>>
> >>
> >
>


Re: RequestProcessor and contentType response header

2009-06-21 Thread Mike Dave
>
> Sounds counter-intuitive. Why should the RequestProcessor overwrite?
>
I am in agreement with you, Avlesh. This behaviour is erratic.
I would recomend upgrading to a later version of struts assuming that the
behaviour has been fixed.

-m-

On Sun, Jun 21, 2009 at 8:46 PM, Avlesh Singh  wrote:
>
>> It's also the weekend.
>>
>> I truly respect that.
>>
>> It's not a bug, that's just how it works.
>>>
>> Sounds counter-intuitive. Why should the RequestProcessor overwrite?
>>
>> Overriding the request processor is the normal way to add behavior to apps
>>> running that version of Struts.
>>>
>> Thanks for approving the solution.
>>
>> Thanks again, Dave.
>>
>> Cheers
>> Avlesh
>>
>>
>> On Sun, Jun 21, 2009 at 5:59 PM, Dave Newton wrote:
>>
>>> Avlesh Singh wrote:
>>>
 Did not get a response yet :(

>>>
>>> It's also the weekend.
>>>
>>>  Is this a dev list question

>>>
>>> No.
>>>
>>>1. Shouldn't this method also check if the response already has a
>   contentType header applied or not? Is this a known bug, or am I
> missing
>   something?
>

>>> It's not a bug, that's just how it works.
>>>
>>>2. I subclassed the RequestProcessor and defined a controller in my
>   struts config as  processorClass="com.me.MyRequestProcessor"/>.
>   The class merely overrides the processContent method to check for an
>   existing contentType. Am I doing it correctly, or is there some other
> way to
>   achieve the desired behavour in my case.
>

>>> Overriding the request processor is the normal way to add behavior to
>>> apps running that version of Struts.
>>>
>>> Dave
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>


basic question about

2009-06-21 Thread jo_atman

Sorry if this is too basic, but i seem to be missing something.
The iterator tag documentation says it iterates over the value on top of the
stack. 
I don't understand what this stack is and what is at the top of the stack.

Can i use the iterator tag to iterate over an object stored as a session
attribute?

Any help much appreciated!
-- 
View this message in context: 
http://www.nabble.com/basic-question-about-%3Cs%3Aiterator%3E-tp24141202p24141202.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: s:select with multiple

2009-06-21 Thread Dave Newton

Bhaarat Sharma wrote:


  Reason1*
  Reason2*
  Reason3*
  Reason4 

> 


When I submit this form I am getting the values like 1 2 3 4 back to my
action class just fine.   What if I want to get the content of the options
also? meaning what If I want to get back Reason1*, reason2* etc back to my
action class also?


*Also*?

That's not really how select tags work. You'd have to build the value 
manually and pull it apart again on the server side. I can't think of 
any reasons why you'd want to do that, though--what, exactly, are you 
trying to accomplish?


Dave

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



emptyoption with s:select and Integer values

2009-06-21 Thread Ignacio de Córdoba

Hello,
I need to use s:select with emptyoption="true" attribute. it works OK with
Strings but can't make it work with Integers. As empty option generates an
empty string option parameter value, Struts2 seems unable to convert it to a
null value if setter method in the Action is Integer. I get:

ognl.MethodFailedException: Method "setPlaceId" failed for object
com.servengine.pim.eventadminacti...@336f9bc6
[java.lang.NoSuchMethodException: setPlaceId([Ljava.lang.String;)]

(An array of Strings? I am just selecting the empty value... anyway...)

Any ideas or workarrounds. I would like to avoid moving all this type of
properties to String.

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/emptyoption-with-s%3Aselect-and-Integer-values-tp24139712p24139712.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



s:select with multiple

2009-06-21 Thread Bhaarat Sharma
I have the following code for s:select tag




Reason1*
Reason2*
Reason3*
Reason4 

When I submit this form I am getting the values like 1 2 3 4 back to my
action class just fine.   What if I want to get the content of the options
also? meaning what If I want to get back Reason1*, reason2* etc back to my
action class also?


Re: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dimitrios Christodoulakis
Thanks! Everyone's suggestions are correct. The versions provided by godaddy
are:
ROOT/usr/java/jdk1.5.0_17, and
ROOT/usr/java/tomcat-5.5

Currently in dev I am using later versions for both. Wes, I think you are
right, I'd need to at least match at those versions mentioned above on my
local development. But, even after matching, do I still need integration
between apache and tomcat on godaddy side, or matching versions between dev
and prod take care of this?

Dave, that is correct, when starting the project on eclipse I am prompted to
select a dynamic web module version (2.2, 2.3, 2.4, 2.5) I am reading online
about the J2EE Web module specification, but can I quickly ask what is the
meaning of a web module? Is it possible to convert backwards between module
versions? Is it eclipse-related, tomcat-related or does it indicate which
servlet/jsp spec I can use?

Apparently older versions of tomcat support only earlier web module
versions. Other than that, are there other reasons of choosing one web
module version over another?

Thanks again for your responses.


On Sun, Jun 21, 2009 at 1:51 PM, Wes Wannemacher  wrote:
>
> The error indicates that you compiled for a jvm newer than the tomcat
> runtime. For instance you compiled with 1.6 and you are trying to run
> on 1.5. Stick to tomcat 5.5 if that is what godaddy provides. The
> tomcat version doesn't indicate its newness as much as it indicates
> which servlet / jsp spec it implements. To save yourself a headache,
> match major/minor version numbers between your dev and production
> environments. To see the setup I was talking about earlier you can
> find patch files in svn somewhere that show how I set it up on the
> struts zone. The advantage is in its simplicity. I am sure it could be
> optimized for better performance, but I like to stick to simple over
> premature optimization. I am on my BlackBerry, so when I boot up my
> laptop I can send an example config.
> -W
>
> On 6/21/09, Dimitrios Christodoulakis  wrote:
> > It seems that indeed the filters are not starting properly: The
catalina.out
> > log indicates the following:
> >
> > 00:45:40,018 ERROR [/myapp]:3639 - Exception starting filter struts2
> > java.lang.UnsupportedClassVersionError: Bad version number in .class
file
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> > ...
> > ...
> >
> > 00:45:40,044 ERROR [/myapp]:3639 - Exception starting filter
HibernateFilter
> > java.lang.UnsupportedClassVersionError: Bad version number in .class
file
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> > at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> > ...
> > ...
> >
> > is it right to assume that "bad verison number in .class file" means
Tomcat
> > 5.5 is unable to run this struts2-hibernate combination? -- Any advice
on
> > deciphering the above errors?
> >
> > --I tried to run it locally on tomcat 5.5 using eclipse, but turns out I
> > cannot even assign this project to 5.5 because - according to eclipse:
"The
> > server does not support version 2.5 of the J2EE Web module
specification."
> >
> >  So, as a next step would you recommend I upgrade to Tomcat 6.0 on
godaddy,
> > or try to integrate Apache with the existing tomcat 5.5 first to see
what
> > happens?
> >
> > Wes, you mentioned below your favorite way of integrating http + tomcat,
> > would you be able to provide a few general steps how to go about doing
this?
> >
> > Many thanks for any help
> >
> >
> >
> > On Sun, Jun 21, 2009 at 12:09 PM, Dimitrios Christodoulakis <
> > dimi@gmail.com> wrote:
> >>
> >> Thanks for the input. I'll test it locally under 5.5. and  will dig
deeper
> > in the logs and see what I can find. I will let you know.
> >>
> >> Appreciate the insight.
> >>
> >> On Sun, Jun 21, 2009 at 11:00 AM, Wes Wannemacher 
wrote:
> >>>
> >>> I'm with dave. Check the logs, in particular, look for messages about
> >>> whether or not the filter started properly. Also check the httpd
> >>> configuration. There are a few ways to integrate httpd and tomcat.
> >>> Many people will use mod_jk but lately I am in favor of having tomcat
> >>> listen on localhost and have httpd reverse proxy all requests. There
> >>> was a belief for a while that httpd should serve static content and
> >>> tomcat serve jsps only. But any more I find tomcat's performance to be
> >>> good enough to serve the static content as well.
> >>>
> >>> On 6/21/09, Dave Newton  wrote:
> >>> > Dimitrios Christodoulakis wrote:
> >>> >> I am having some issues deploying a struts2 application at godaddy
and
> > was
> >>> >> wondering if anyone has dealt with something similar in the past.
The
> >>> >> application runs fine on my local machine with tomcat 6.0. My next
> > step
> >>> >> was
> >>> >> to upload and deploy at godaddy dedicated server which is running
> > tomcat
> >>> >> 5.5
> >>> >
> >>> > D

Re: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Balwinder Kumar
This is probably due to the fact that the version of Java useed in 
deployment environment is lower than the version of Java used for 
compiling Hibernate classes.



Dimitrios Christodoulakis wrote:

It seems that indeed the filters are not starting properly: The catalina.out
log indicates the following:

00:45:40,018 ERROR [/myapp]:3639 - Exception starting filter struts2
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
...
...

00:45:40,044 ERROR [/myapp]:3639 - Exception starting filter HibernateFilter
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
...
...

is it right to assume that "bad verison number in .class file" means Tomcat
5.5 is unable to run this struts2-hibernate combination? -- Any advice on
deciphering the above errors?

--I tried to run it locally on tomcat 5.5 using eclipse, but turns out I
cannot even assign this project to 5.5 because - according to eclipse: "The
server does not support version 2.5 of the J2EE Web module specification."

 So, as a next step would you recommend I upgrade to Tomcat 6.0 on godaddy,
or try to integrate Apache with the existing tomcat 5.5 first to see what
happens?

Wes, you mentioned below your favorite way of integrating http + tomcat,
would you be able to provide a few general steps how to go about doing this?

Many thanks for any help



On Sun, Jun 21, 2009 at 12:09 PM, Dimitrios Christodoulakis <
dimi@gmail.com> wrote:
  

Thanks for the input. I'll test it locally under 5.5. and  will dig deeper


in the logs and see what I can find. I will let you know.
  

Appreciate the insight.

On Sun, Jun 21, 2009 at 11:00 AM, Wes Wannemacher  wrote:


I'm with dave. Check the logs, in particular, look for messages about
whether or not the filter started properly. Also check the httpd
configuration. There are a few ways to integrate httpd and tomcat.
Many people will use mod_jk but lately I am in favor of having tomcat
listen on localhost and have httpd reverse proxy all requests. There
was a belief for a while that httpd should serve static content and
tomcat serve jsps only. But any more I find tomcat's performance to be
good enough to serve the static content as well.

On 6/21/09, Dave Newton  wrote:
  

Dimitrios Christodoulakis wrote:


I am having some issues deploying a struts2 application at godaddy and
  

was
  

wondering if anyone has dealt with something similar in the past. The
application runs fine on my local machine with tomcat 6.0. My next
  

step
  

was
to upload and deploy at godaddy dedicated server which is running
  

tomcat
  

5.5
  

Does it run locally under 5.5?



The upload of the war file and expansion works fine, and the static
  

html
  

display fine too. But as soon as a struts2 action is called, I always
  

get
  

the 404 not found error: The requested URL /Menu.action was not found
  

on
  

this server.
  

What's in the logs?

Dave

-
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: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Wes Wannemacher
The error indicates that you compiled for a jvm newer than the tomcat
runtime. For instance you compiled with 1.6 and you are trying to run
on 1.5. Stick to tomcat 5.5 if that is what godaddy provides. The
tomcat version doesn't indicate its newness as much as it indicates
which servlet / jsp spec it implements. To save yourself a headache,
match major/minor version numbers between your dev and production
environments. To see the setup I was talking about earlier you can
find patch files in svn somewhere that show how I set it up on the
struts zone. The advantage is in its simplicity. I am sure it could be
optimized for better performance, but I like to stick to simple over
premature optimization. I am on my BlackBerry, so when I boot up my
laptop I can send an example config.
-W

On 6/21/09, Dimitrios Christodoulakis  wrote:
> It seems that indeed the filters are not starting properly: The catalina.out
> log indicates the following:
>
> 00:45:40,018 ERROR [/myapp]:3639 - Exception starting filter struts2
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> ...
> ...
>
> 00:45:40,044 ERROR [/myapp]:3639 - Exception starting filter HibernateFilter
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> ...
> ...
>
> is it right to assume that "bad verison number in .class file" means Tomcat
> 5.5 is unable to run this struts2-hibernate combination? -- Any advice on
> deciphering the above errors?
>
> --I tried to run it locally on tomcat 5.5 using eclipse, but turns out I
> cannot even assign this project to 5.5 because - according to eclipse: "The
> server does not support version 2.5 of the J2EE Web module specification."
>
>  So, as a next step would you recommend I upgrade to Tomcat 6.0 on godaddy,
> or try to integrate Apache with the existing tomcat 5.5 first to see what
> happens?
>
> Wes, you mentioned below your favorite way of integrating http + tomcat,
> would you be able to provide a few general steps how to go about doing this?
>
> Many thanks for any help
>
>
>
> On Sun, Jun 21, 2009 at 12:09 PM, Dimitrios Christodoulakis <
> dimi@gmail.com> wrote:
>>
>> Thanks for the input. I'll test it locally under 5.5. and  will dig deeper
> in the logs and see what I can find. I will let you know.
>>
>> Appreciate the insight.
>>
>> On Sun, Jun 21, 2009 at 11:00 AM, Wes Wannemacher  wrote:
>>>
>>> I'm with dave. Check the logs, in particular, look for messages about
>>> whether or not the filter started properly. Also check the httpd
>>> configuration. There are a few ways to integrate httpd and tomcat.
>>> Many people will use mod_jk but lately I am in favor of having tomcat
>>> listen on localhost and have httpd reverse proxy all requests. There
>>> was a belief for a while that httpd should serve static content and
>>> tomcat serve jsps only. But any more I find tomcat's performance to be
>>> good enough to serve the static content as well.
>>>
>>> On 6/21/09, Dave Newton  wrote:
>>> > Dimitrios Christodoulakis wrote:
>>> >> I am having some issues deploying a struts2 application at godaddy and
> was
>>> >> wondering if anyone has dealt with something similar in the past. The
>>> >> application runs fine on my local machine with tomcat 6.0. My next
> step
>>> >> was
>>> >> to upload and deploy at godaddy dedicated server which is running
> tomcat
>>> >> 5.5
>>> >
>>> > Does it run locally under 5.5?
>>> >
>>> >> The upload of the war file and expansion works fine, and the static
> html
>>> >> display fine too. But as soon as a struts2 action is called, I always
> get
>>> >> the 404 not found error: The requested URL /Menu.action was not found
> on
>>> >> this server.
>>> >
>>> > What's in the logs?
>>> >
>>> > Dave
>>> >
>>> > -
>>> > 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
>>>
>>
>


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

Re: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dave Newton

Dimitrios Christodoulakis wrote:

It seems that indeed the filters are not starting properly: The catalina.out
log indicates the following:

00:45:40,018 ERROR [/myapp]:3639 - Exception starting filter struts2
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
...
...

00:45:40,044 ERROR [/myapp]:3639 - Exception starting filter HibernateFilter
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
...
...

is it right to assume that "bad verison number in .class file" means Tomcat
5.5 is unable to run this struts2-hibernate combination? -- Any advice on
deciphering the above errors?


No, it means that you've probably compiled under 1.6 and are deploying 
under 1.5. Oftentimes searching the web for an exception will provide 
hints as to what's going wrong.



--I tried to run it locally on tomcat 5.5 using eclipse, but turns out I
cannot even assign this project to 5.5 because - according to eclipse: "The
server does not support version 2.5 of the J2EE Web module specification."


Is there any reason you need to use 2.5?

Dave

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



Re: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dimitrios Christodoulakis
It seems that indeed the filters are not starting properly: The catalina.out
log indicates the following:

00:45:40,018 ERROR [/myapp]:3639 - Exception starting filter struts2
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
...
...

00:45:40,044 ERROR [/myapp]:3639 - Exception starting filter HibernateFilter
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
...
...

is it right to assume that "bad verison number in .class file" means Tomcat
5.5 is unable to run this struts2-hibernate combination? -- Any advice on
deciphering the above errors?

--I tried to run it locally on tomcat 5.5 using eclipse, but turns out I
cannot even assign this project to 5.5 because - according to eclipse: "The
server does not support version 2.5 of the J2EE Web module specification."

 So, as a next step would you recommend I upgrade to Tomcat 6.0 on godaddy,
or try to integrate Apache with the existing tomcat 5.5 first to see what
happens?

Wes, you mentioned below your favorite way of integrating http + tomcat,
would you be able to provide a few general steps how to go about doing this?

Many thanks for any help



On Sun, Jun 21, 2009 at 12:09 PM, Dimitrios Christodoulakis <
dimi@gmail.com> wrote:
>
> Thanks for the input. I'll test it locally under 5.5. and  will dig deeper
in the logs and see what I can find. I will let you know.
>
> Appreciate the insight.
>
> On Sun, Jun 21, 2009 at 11:00 AM, Wes Wannemacher  wrote:
>>
>> I'm with dave. Check the logs, in particular, look for messages about
>> whether or not the filter started properly. Also check the httpd
>> configuration. There are a few ways to integrate httpd and tomcat.
>> Many people will use mod_jk but lately I am in favor of having tomcat
>> listen on localhost and have httpd reverse proxy all requests. There
>> was a belief for a while that httpd should serve static content and
>> tomcat serve jsps only. But any more I find tomcat's performance to be
>> good enough to serve the static content as well.
>>
>> On 6/21/09, Dave Newton  wrote:
>> > Dimitrios Christodoulakis wrote:
>> >> I am having some issues deploying a struts2 application at godaddy and
was
>> >> wondering if anyone has dealt with something similar in the past. The
>> >> application runs fine on my local machine with tomcat 6.0. My next
step
>> >> was
>> >> to upload and deploy at godaddy dedicated server which is running
tomcat
>> >> 5.5
>> >
>> > Does it run locally under 5.5?
>> >
>> >> The upload of the war file and expansion works fine, and the static
html
>> >> display fine too. But as soon as a struts2 action is called, I always
get
>> >> the 404 not found error: The requested URL /Menu.action was not found
on
>> >> this server.
>> >
>> > What's in the logs?
>> >
>> > Dave
>> >
>> > -
>> > 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: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dimitrios Christodoulakis
Thanks for the input. I'll test it locally under 5.5. and  will dig deeper
in the logs and see what I can find. I will let you know.

Appreciate the insight.

On Sun, Jun 21, 2009 at 11:00 AM, Wes Wannemacher  wrote:

> I'm with dave. Check the logs, in particular, look for messages about
> whether or not the filter started properly. Also check the httpd
> configuration. There are a few ways to integrate httpd and tomcat.
> Many people will use mod_jk but lately I am in favor of having tomcat
> listen on localhost and have httpd reverse proxy all requests. There
> was a belief for a while that httpd should serve static content and
> tomcat serve jsps only. But any more I find tomcat's performance to be
> good enough to serve the static content as well.
>
> On 6/21/09, Dave Newton  wrote:
> > Dimitrios Christodoulakis wrote:
> >> I am having some issues deploying a struts2 application at godaddy and
> was
> >> wondering if anyone has dealt with something similar in the past. The
> >> application runs fine on my local machine with tomcat 6.0. My next step
> >> was
> >> to upload and deploy at godaddy dedicated server which is running tomcat
> >> 5.5
> >
> > Does it run locally under 5.5?
> >
> >> The upload of the war file and expansion works fine, and the static html
> >> display fine too. But as soon as a struts2 action is called, I always
> get
> >> the 404 not found error: The requested URL /Menu.action was not found on
> >> this server.
> >
> > What's in the logs?
> >
> > Dave
> >
> > -
> > 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: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Wes Wannemacher
I'm with dave. Check the logs, in particular, look for messages about
whether or not the filter started properly. Also check the httpd
configuration. There are a few ways to integrate httpd and tomcat.
Many people will use mod_jk but lately I am in favor of having tomcat
listen on localhost and have httpd reverse proxy all requests. There
was a belief for a while that httpd should serve static content and
tomcat serve jsps only. But any more I find tomcat's performance to be
good enough to serve the static content as well.

On 6/21/09, Dave Newton  wrote:
> Dimitrios Christodoulakis wrote:
>> I am having some issues deploying a struts2 application at godaddy and was
>> wondering if anyone has dealt with something similar in the past. The
>> application runs fine on my local machine with tomcat 6.0. My next step
>> was
>> to upload and deploy at godaddy dedicated server which is running tomcat
>> 5.5
>
> Does it run locally under 5.5?
>
>> The upload of the war file and expansion works fine, and the static html
>> display fine too. But as soon as a struts2 action is called, I always get
>> the 404 not found error: The requested URL /Menu.action was not found on
>> this server.
>
> What's in the logs?
>
> Dave
>
> -
> 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: deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dave Newton

Dimitrios Christodoulakis wrote:

I am having some issues deploying a struts2 application at godaddy and was
wondering if anyone has dealt with something similar in the past. The
application runs fine on my local machine with tomcat 6.0. My next step was
to upload and deploy at godaddy dedicated server which is running tomcat 5.5


Does it run locally under 5.5?


The upload of the war file and expansion works fine, and the static html
display fine too. But as soon as a struts2 action is called, I always get
the 404 not found error: The requested URL /Menu.action was not found on
this server.


What's in the logs?

Dave

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



Re: RequestProcessor and contentType response header

2009-06-21 Thread Avlesh Singh
>
> It's also the weekend.

I truly respect that.

It's not a bug, that's just how it works.
>
Sounds counter-intuitive. Why should the RequestProcessor overwrite?

Overriding the request processor is the normal way to add behavior to apps
> running that version of Struts.
>
Thanks for approving the solution.

Thanks again, Dave.

Cheers
Avlesh

On Sun, Jun 21, 2009 at 5:59 PM, Dave Newton  wrote:

> Avlesh Singh wrote:
>
>> Did not get a response yet :(
>>
>
> It's also the weekend.
>
>  Is this a dev list question
>>
>
> No.
>
>1. Shouldn't this method also check if the response already has a
>>>   contentType header applied or not? Is this a known bug, or am I missing
>>>   something?
>>>
>>
> It's not a bug, that's just how it works.
>
>2. I subclassed the RequestProcessor and defined a controller in my
>>>   struts config as >> processorClass="com.me.MyRequestProcessor"/>.
>>>   The class merely overrides the processContent method to check for an
>>>   existing contentType. Am I doing it correctly, or is there some other
>>> way to
>>>   achieve the desired behavour in my case.
>>>
>>
> Overriding the request processor is the normal way to add behavior to apps
> running that version of Struts.
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


deploying struts2 at godaddy dedicated server - general question

2009-06-21 Thread Dimitrios Christodoulakis
Hello everyone,

I am having some issues deploying a struts2 application at godaddy and was
wondering if anyone has dealt with something similar in the past. The
application runs fine on my local machine with tomcat 6.0. My next step was
to upload and deploy at godaddy dedicated server which is running tomcat 5.5
- The underlying server is  Apache/2.2.8 (Fedora)

The upload of the war file and expansion works fine, and the static html
display fine too. But as soon as a struts2 action is called, I always get
the 404 not found error: The requested URL /Menu.action was not found on
this server.

Their customer service basically can help only if we buy their "assisted"
plan.

I'd like to start by asking this as a general question, and find out if
anyone had similar issues and how they resolved it. Is it a prticular
setting on the dedicated server that might help perhaps?

The hosting and development frameworks are fixed by the customer.

Thank you in advance.


Re: empty validation.xml file - please help.

2009-06-21 Thread Yanto
are you using simple theme and struts 2.1.6 ? if yes you need to use tags
s:fielderror and s:actionerror to display error

On Sun, Jun 21, 2009 at 8:45 PM, Sam Wun  wrote:

> Hi,
>
> I tried generate a validation.xml file with "form name", "field
> property", "msg name",  and "key" in the file, but it doesn't generate
> these information in the file from the struts tags given in my
> ActionForm java file.
>
> Here is the java soruce file I have:
>
> package com.XYZ.onlinepayment.portlet;
>
> import org.apache.struts.validator.ValidatorForm;
> import javax.servlet.http.HttpServletRequest;
>
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.action.ActionMessage;
>
> /**
>  * Search query entry form.
>  *
>  * @struts.form name="OrderForm"
>  */
> public class OrderForm extends ActionForm{
>   private String firstname="";
>   private String lastname="";
>   private String email_address="";
>   private String phone_number="";
>   private String shipping_address="";
>   private String billing_address="";
>   /**
>* Sets the query attribute of the OrderForm object
>*
>* @struts.validator type="required" msgkey="error.firstname.required"
>*/
>   public void setFirstName(String fn){
>   this.firstname = fn;
>   }
>   public String getFirstName(){
>   return this.firstname;
>   }
>   /*
>* @struts.validator type="required" msgkey="error.lastname.required"
>*/
>   public void setLastName(String ln){
>   this.lastname = ln;
>   }
>   public String getLastName(){
>   return this.lastname;
>   }
>/*
>* @struts.validator type="required"
> msgkey="error.email_address.required"
>*/
>   public void setEmailAddress(String email){
>   this.email_address = email;
>   }
>   public String getEmailAddress(){
>   return this.email_address;
>   }
>/*
>* @struts.validator type="required"
> msgkey="error.shipping_address.required"
>*/
>   public void setShippingAddress(String shipping) {
>   this.shipping_address = shipping;
>   }
>   public String getShippingAddress(){
>   return this.shipping_address;
>   }
>/*
>* @struts.validator type="required"
> msgkey="error.billing_address.required"
>*/
>   public void setBillingAddress(String billing) {
>   this.billing_address = billing;
>   }
>
>   public String getBillingAddress(){
>   return this.billing_address;
>   }
>/*
>* @struts.validator type="required" msgkey="error.phone_number.required"
>*/
>   public void setPhoneNumber(String ph) {
>   this.phone_number = ph;
>   }
>   public String getPhoneNumber(){
>   return this.phone_number;
>   }
>
>   public void reset(ActionMapping mapping, HttpServletRequest req) {
>   this.firstname="";
>   this.lastname="";
>   this.phone_number="";
>   this.email_address="";
>   this.shipping_address="";
>   this.billing_address="";
>   }
>
> 
>
>
> And I also tried to run Ant with "ant -Dform.name=OrderForm" and just
> the "ant " command. It only genereated the following "empty"
> validation.xml file:
>  # cat validation.xml
> 
>  Commons Validator Rules Configuration 1.1//EN"
> "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
>
> 
>  
>  
>  
>
>  
> 
>
> What is wrong with my setup?
>
> Thanks
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


empty validation.xml file - please help.

2009-06-21 Thread Sam Wun
Hi,

I tried generate a validation.xml file with "form name", "field
property", "msg name",  and "key" in the file, but it doesn't generate
these information in the file from the struts tags given in my
ActionForm java file.

Here is the java soruce file I have:

package com.XYZ.onlinepayment.portlet;

import org.apache.struts.validator.ValidatorForm;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 * Search query entry form.
 *
 * @struts.form name="OrderForm"
 */
public class OrderForm extends ActionForm{
   private String firstname="";
   private String lastname="";
   private String email_address="";
   private String phone_number="";
   private String shipping_address="";
   private String billing_address="";
   /**
* Sets the query attribute of the OrderForm object
*
* @struts.validator type="required" msgkey="error.firstname.required"
*/
   public void setFirstName(String fn){
   this.firstname = fn;
   }
   public String getFirstName(){
   return this.firstname;
   }
   /*
* @struts.validator type="required" msgkey="error.lastname.required"
*/
   public void setLastName(String ln){
   this.lastname = ln;
   }
   public String getLastName(){
   return this.lastname;
   }
/*
* @struts.validator type="required" msgkey="error.email_address.required"
*/
   public void setEmailAddress(String email){
   this.email_address = email;
   }
   public String getEmailAddress(){
   return this.email_address;
   }
/*
* @struts.validator type="required"
msgkey="error.shipping_address.required"
*/
   public void setShippingAddress(String shipping) {
   this.shipping_address = shipping;
   }
   public String getShippingAddress(){
   return this.shipping_address;
   }
/*
* @struts.validator type="required" msgkey="error.billing_address.required"
*/
   public void setBillingAddress(String billing) {
   this.billing_address = billing;
   }

   public String getBillingAddress(){
   return this.billing_address;
   }
/*
* @struts.validator type="required" msgkey="error.phone_number.required"
*/
   public void setPhoneNumber(String ph) {
   this.phone_number = ph;
   }
   public String getPhoneNumber(){
   return this.phone_number;
   }

   public void reset(ActionMapping mapping, HttpServletRequest req) {
   this.firstname="";
   this.lastname="";
   this.phone_number="";
   this.email_address="";
   this.shipping_address="";
   this.billing_address="";
   }




And I also tried to run Ant with "ant -Dform.name=OrderForm" and just
the "ant " command. It only genereated the following "empty"
validation.xml file:
 # cat validation.xml

http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>


 
 
 

 


What is wrong with my setup?

Thanks

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



Re: RequestProcessor and contentType response header

2009-06-21 Thread Dave Newton

Avlesh Singh wrote:

Did not get a response yet :(


It's also the weekend.

Is this a dev list question 


No.


   1. Shouldn't this method also check if the response already has a
   contentType header applied or not? Is this a known bug, or am I missing
   something?


It's not a bug, that's just how it works.


   2. I subclassed the RequestProcessor and defined a controller in my
   struts config as .
   The class merely overrides the processContent method to check for an
   existing contentType. Am I doing it correctly, or is there some other way to
   achieve the desired behavour in my case.


Overriding the request processor is the normal way to add behavior to 
apps running that version of Struts.


Dave

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



Re: Return to previous page without javascript

2009-06-21 Thread Girish Naik
Is this issue solved?

Can we do something like
this

Regards,
-
Girish Naik
Mobile:-+91-09740091638
girish.n...@gmail.com
Henny Youngman
- "I told the doctor I broke my leg in two places. He told me to quit
going
to those places."

On Mon, Jun 15, 2009 at 8:11 PM, Stefano Tranquillini <
stefano.tranquill...@gmail.com> wrote:

> I tried to use request and URI but:
> - i'm not able to have some result from this command.
> - how can i set this value inside the session from a jsp.
>
> thanks.
>
>
>
> --
> Stefano
>


Re: RequestProcessor and contentType response header

2009-06-21 Thread Avlesh Singh
Did not get a response yet :(
Is this a dev list question or my assumptions are correct?

Cheers
Avlesh

On Sat, Jun 20, 2009 at 8:21 PM, Avlesh Singh  wrote:

> I am using Struts 1.2.7
> I wrote a Filter which intercepts all requests and applies response headers
> (based on some external configuration) to it. All response headers applied
> in my Filter other than "Content-Type" were obeyed and sent to the client.
> Content-Type was always "text/html".
> After a lot of debugging, I realized the value for this particular header
> are always getting overwritten in the struts' RequestProcessor class.
> Underneath is the method which in my case turned out to be the "culprit"
>
>>
>> protected void processContent(HttpServletRequest request,
>>HttpServletResponse response) {
>> String contentType =
>> moduleConfig.getControllerConfig().getContentType();
>> if (contentType != null) {
>>response.setContentType(contentType);
>>  }
>> }
>>
>
> Couple of questions:
>
>1. Shouldn't this method also check if the response already has a
>contentType header applied or not? Is this a known bug, or am I missing
>something?
>2. I subclassed the RequestProcessor and defined a controller in my
>struts config as .
>The class merely overrides the processContent method to check for an
>existing contentType. Am I doing it correctly, or is there some other way 
> to
>achieve the desired behavour in my case.
>
> Cheers
> Avlesh
>


Re: Struts2 and Security

2009-06-21 Thread dusty

We have used Spring Security in the last 10 struts2 apps.  We have some that
use a local user store in the database, others that use LDAP to AD and some
that use Atlassian's Crowd.  

Spring Security is very easy to add to your app and gives just about
everything you need I have not ventured into some of the more advanced
ACL features for securing individual objects, but it is also fairly straight
forward to provide method level security.  

A good example of Spring Security implemented on top of Struts2 is the
appfuse framework.  http://appfuse.org.




aum strut wrote:
> 
> Hi All,
> 
> We are on the way to develop a new application using struts2. Currently we
> are analysing the area of authentication and authorization, we do have
> some
> options of using the following frame work for these
> 
> 1) Acegi
> 2)JAAS
> 
> my point is that we any one in the list is using any of the security frame
> work.please let me know about there experiences, so that it will help us
> in
> choosing the right security model.
> 
> regarding the pltfrom we have decided to use is as follows
> 
> 1) Struts2
> 2) JSP/Velocity
> 3) Hibernate
> 4) YUI
> 
> these are the core building block rest technologies and frame work can be
> choosen as required
> 
> looking forward for your valuable suggestions.
> 
> thannks in advance
> aum
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts2-and-Security-tp24106660p24132071.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