Re: action-method-validation

2009-07-20 Thread Jim Kiley
Do you mean, can I write a validateFoo() method for my foo() action method
and be sure validateFoo() will run before foo() does?  Yes.
jk

On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo  wrote:

> Hi,
>
> Does struts2 support action-method-validation ?
>
>
> Regards
> Louis




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


Re: Pb displaying image

2009-07-20 Thread Jim Kiley
Make sure the image is visible to your webserver, and then use an
http://url to access it, rather than a file:// url.
jk

On Mon, Jul 20, 2009 at 11:08 AM, tutu  wrote:

>
> Hi,
>
> I have a pb while trying to display an image that is not in my application
> but on the file system!!
>
> I've tried to put this in my jsp:
>
> file:///<%=request.getAttribute( /1.png">
>
> and that too:
>  src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> /1.png"/>
>
> (imageLocation reference D:/images)
>
> but nothing is displayed. Does anybody knows how to display an image that
> is
> not in the web application?
>
> thanks,
>
> tugdual
> --
> View this message in context:
> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.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
>
>


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


Re: Prevent persisting data when validation fails

2009-07-20 Thread Jim Kiley
What are you using to manage persistence?  Can we see your action's source
code?

On Mon, Jul 20, 2009 at 5:42 AM, taltun  wrote:

>
> When submitting a form using manual validation in my action. Even when the
> validation fails and the action method supposed to be called is not called
> at all, the dirty data is persisted ?
>
> How can I prevent data from being persisted if the validation fails ?
>
> Note:  I use prepare method to load e.g an user object from a
> manager/service. And the data relates to the user object that is about.
>
> -taltun
> --
> View this message in context:
> http://www.nabble.com/Prevent-persisting-data-when-validation-fails-tp24566713p24566713.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
>
>


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


Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Jim Kiley
I think I missed the early part of the discussion -- I assume that the
OpenEntityManagerInViewFilter is not the solution for you?
jk

On Fri, Jul 17, 2009 at 2:53 PM, Nathan Schulte wrote:

> So is this the only resolution out there?  To lazily initialize the
> contents I
> know I'll need before the container decides to trash the persistence
> context?
> There is no way to extend the context such that the lazy initialization
> will
> work when rendering the view?
>
>
>
>
>
> -
> 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: struts 2 adoption/performance/scalability

2009-07-17 Thread Jim Kiley
I don't have any benchmark numbers, but we're using it in production at my
current client, running a b2b ecommerce site with about 3,000 active
customers that pushed through about 4,000 orders in the last month.
jk

On Thu, Jul 16, 2009 at 7:12 PM, Musachy Barroso  wrote:

> I am trying to "sell" the idea of using Struts 2 to my employer, and I
> know these questions will come up:
>
> 1. Who is using it?
> 2. How does it perform, compared to plain servlets and jsps?
> 3. How well does it scale?
> 4. Has anyone benchmark it under load? numbers?
>
> 2-4 are somewhat related. I am sure many of you have gone through this
> before, so if you can share some info with me I would appreciate it
> (believe it or not I haven't built a production application with
> struts 2 yet)
>
> thanks
> musachy
> --
> "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
>
>


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


Re: dynamic return when validation failed

2009-07-09 Thread Jim Kiley
On Thu, Jul 9, 2009 at 5:26 AM,  wrote:

>
> Well, if I remove my validation code in the validate() method and put it
> into execute() method, then I can easily control which logical name to be
> return, but I thought that is not a good way to do that right?
>

While this might not be a "good way to do that," it's what I would do and in
fact have done.
-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


Re: Interceptors and Thread safety

2009-07-08 Thread Jim Kiley
The easiest (I'm not saying best) way to ensure thread safety is to keep
your data in method local variables, rather than in fields on the
interceptor.  Local variables are threadsafe.
jk

On Wed, Jul 8, 2009 at 9:08 AM, ravi_eze wrote:

>
> hi,
>
> http://struts.apache.org/2.x/docs/writing-interceptors.html says that
> interceptors are not thread safe, i wanted a deeper understanding on this.
>
> Case:
> 1. Suppose i have 2 action tags each having an interceptor (I) referenced
> in
> it
> 2. 2 action tags with interceptors referenced *twice in each* of them
>
> If interceptors are not thread safe then how many instances of the objects
> are created in the above cases. My common-sense says 2 & 4 objects
> respectively.
>
> Now,
> I have an interceptor which takes data from the struts.xml in the form of
> params tags. The value of these param tags are held in the interceptor
> class's field variables. I have this interceptor included in my struts.xml
> as said in the case1 and 2 above. Now on concurrent requests do i get
> threading issues? Please clarify.
>
> Is it thread safe if i dont put the field variables related to the internal
> processing of the class? i.e.. i have field variables only related to the
> param tags only and nothing more. Now is the interceptor thread safe?
>
> Kindly clarify.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Interceptors-and-Thread-safety-tp24391223p24391223.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
>
>


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


Re: dojo ajax tags -- post vs. get

2009-07-07 Thread Jim Kiley
It turns out that the problem was solved by removing nesting form tags.  I
hadn't noticed, originally, that the "familySelection" form described below
was wrapped by another form tag.  When I unwrapped it, everything worked
correctly.  Let this be a lesson to you. Somebody.
jk

On Tue, Jul 7, 2009 at 3:36 PM, Jim Kiley  wrote:

> Hi gang,
> We are taking our first steps into using the dojo tags, in a Struts 2.1.7
> project (yes, we jumped too soon, I don't think it's entirely relevant).
>  Specifically I've got an  tag set up, and when its value changes,
> I publish a dojo event ("/changeFamily").  A div is set up with  as
> follows:
>
> 
>headerValue="Select One" list="familyList"
> onchange="dojo.event.topic.publish('/changeFamily');" />
> 
>
> 
>  href="%{catalogContentsUrl}" listenTopics="/changeFamily">
>   (No family selected)
> 
>
> When I change a value in the s:select, however, Firebug tells me that the
> page is executing a GET rather than a POST.  So the value of familyId never
> gets posted (breakpoints indicate that the setter does not run).
>
> What do I have to do in order to get the value of familyId to be posted?
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>



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


dojo ajax tags -- post vs. get

2009-07-07 Thread Jim Kiley
Hi gang,
We are taking our first steps into using the dojo tags, in a Struts 2.1.7
project (yes, we jumped too soon, I don't think it's entirely relevant).
 Specifically I've got an  tag set up, and when its value changes,
I publish a dojo event ("/changeFamily").  A div is set up with  as
follows:


  




  (No family selected)


When I change a value in the s:select, however, Firebug tells me that the
page is executing a GET rather than a POST.  So the value of familyId never
gets posted (breakpoints indicate that the setter does not run).

What do I have to do in order to get the value of familyId to be posted?
-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Jim Kiley
I will bet one dollar that the amount of time it takes to calculate this
value inside your Action class is less than or equal to the time it takes it
to calculate the value inside the iterator in your JSP.  And it's a
vanishingly small amount compared to network latency.  Unless you're writing
code that's going to be hammered at the requests-per-second scale,
optimizing out a for loop is not the best use of your time as a developer.

When you're doing initial development, optimize in favor of readability and
testability.  Once you're in or close to production, analyze to find
bottlenecks.  Finding the sum of a bunch of values is not going to be your
bottleneck.

jk

On Wed, Jul 1, 2009 at 5:03 PM, Bhaarat Sharma  wrote:

> but if I do it in my action class then I am adding extra 'time'.
> to begin with I anyways have to iterate over the list in my JSP.  Just to
> calculate total if I iterate over the list again in java code then I am
> doing two iterations through the list.  Just didnt seem very efficient for
> my need.
>
> Thanks for your suggestion!! :)
>
>
> On Wed, Jul 1, 2009 at 4:59 PM, Jim Kiley  wrote:
>
> > I don't know how Struts 2 tags work under the hood, but it's possible
> that
> > it's going out of scope because you declared it in the iterator, or it's
> > silently throwing an error because it isn't initialized.  Before your
> >  starts, do .
> > This could be handled inside your action class with like two lines of
> code,
> > of course, and as a side benefit you could write meaningful unit tests to
> > be
> > sure you'd gotten it right.
> >
> > jk
> >
> > On Wed, Jul 1, 2009 at 4:55 PM, Bhaarat Sharma 
> > wrote:
> >
> > > no :(
> > > I tried the following
> > > 
> > >> "totalCount"/>
> > >> > value="%{calcTotalDebtAmt+totalCount}"/>
> > > 
> > >
> > > and tried to print it
> > > 
> > >
> > > but it shows nothing :(
> > >
> > > On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley 
> > wrote:
> > >
> > > > Does it work if you replace the "+=" with a "+"?
> > > > jk
> > > >
> > > > On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma 
> > > > wrote:
> > > >
> > > > > Does anyone know how to calculate the total value by making use of
> > the
> > > > >  tag?
> > > > > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma <
> bhaara...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > for our purpose i'd prefer doing it in the iterator tag.
> > > > > > I tried something like this
> > > > > >
> > > > > >  > > > > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > > > > >
> > > > > > but this does not seem to work.
> > > > > >
> > > > > > what can fix this?
> > > > > >
> > > > > >
> > > > > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley <
> > jhki...@summa-tech.com
> > > > > >wrote:
> > > > > >
> > > > > >> You're far better off doing it inside the Action class.
> > > > > >> That said, you can probably use s:set to get what you want.
> > > > > >>
> > > > > >> jk
> > > > > >>
> > > > > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma <
> > > bhaara...@gmail.com
> > > > > >> >wrote:
> > > > > >>
> > > > > >> > Hi,
> > > > > >> > I have a simple iterator tag like the following
> > > > > >> >
> > > > > >> > 
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > 
> > > > > >> >
> > > > > >> > is there a way to get the total of value1 at the end of this
> > > > iterator
> > > > > >> tag?
> > > > > >> >
> > > > > >> > basically in java we would do totalValue += value1; and then
> at
> > > the
> > > > > end
> > > > > >> of
> > > > > >> > the loop we would have total of value1.
> > > > > >> >
> > > > > >> > Is that possible to do with an iterator tag?
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >> Jim Kiley
> > > > > >> Senior Technical Consultant | Summa
> > > > > >> [p] 412.258.3346
> > > > > >> http://www.summa-tech.com
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Jim Kiley
> > > > Senior Technical Consultant | Summa
> > > > [p] 412.258.3346
> > > > http://www.summa-tech.com
> > > >
> > >
> >
> >
> >
> > --
> > Jim Kiley
> > Senior Technical Consultant | Summa
> > [p] 412.258.3346
> > http://www.summa-tech.com
> >
>



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


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Jim Kiley
I don't know how Struts 2 tags work under the hood, but it's possible that
it's going out of scope because you declared it in the iterator, or it's
silently throwing an error because it isn't initialized.  Before your
 starts, do .
This could be handled inside your action class with like two lines of code,
of course, and as a side benefit you could write meaningful unit tests to be
sure you'd gotten it right.

jk

On Wed, Jul 1, 2009 at 4:55 PM, Bhaarat Sharma  wrote:

> no :(
> I tried the following
> 
>   
>value="%{calcTotalDebtAmt+totalCount}"/>
> 
>
> and tried to print it
> 
>
> but it shows nothing :(
>
> On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley  wrote:
>
> > Does it work if you replace the "+=" with a "+"?
> > jk
> >
> > On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma 
> > wrote:
> >
> > > Does anyone know how to calculate the total value by making use of the
> > >  tag?
> > > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma 
> > > wrote:
> > >
> > > > for our purpose i'd prefer doing it in the iterator tag.
> > > > I tried something like this
> > > >
> > > >  > > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > > >
> > > > but this does not seem to work.
> > > >
> > > > what can fix this?
> > > >
> > > >
> > > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley  > > >wrote:
> > > >
> > > >> You're far better off doing it inside the Action class.
> > > >> That said, you can probably use s:set to get what you want.
> > > >>
> > > >> jk
> > > >>
> > > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma <
> bhaara...@gmail.com
> > > >> >wrote:
> > > >>
> > > >> > Hi,
> > > >> > I have a simple iterator tag like the following
> > > >> >
> > > >> > 
> > > >> >
> > > >> >    
> > > >> >
> > > >> > 
> > > >> >
> > > >> > is there a way to get the total of value1 at the end of this
> > iterator
> > > >> tag?
> > > >> >
> > > >> > basically in java we would do totalValue += value1; and then at
> the
> > > end
> > > >> of
> > > >> > the loop we would have total of value1.
> > > >> >
> > > >> > Is that possible to do with an iterator tag?
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Jim Kiley
> > > >> Senior Technical Consultant | Summa
> > > >> [p] 412.258.3346
> > > >> http://www.summa-tech.com
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Jim Kiley
> > Senior Technical Consultant | Summa
> > [p] 412.258.3346
> > http://www.summa-tech.com
> >
>



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


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Jim Kiley
Does it work if you replace the "+=" with a "+"?
jk

On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma  wrote:

> Does anyone know how to calculate the total value by making use of the
>  tag?
> On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma 
> wrote:
>
> > for our purpose i'd prefer doing it in the iterator tag.
> > I tried something like this
> >
> >  value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> >
> > but this does not seem to work.
> >
> > what can fix this?
> >
> >
> > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley  >wrote:
> >
> >> You're far better off doing it inside the Action class.
> >> That said, you can probably use s:set to get what you want.
> >>
> >> jk
> >>
> >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma  >> >wrote:
> >>
> >> > Hi,
> >> > I have a simple iterator tag like the following
> >> >
> >> > 
> >> >
> >> >
> >> >
> >> > 
> >> >
> >> > is there a way to get the total of value1 at the end of this iterator
> >> tag?
> >> >
> >> > basically in java we would do totalValue += value1; and then at the
> end
> >> of
> >> > the loop we would have total of value1.
> >> >
> >> > Is that possible to do with an iterator tag?
> >> >
> >>
> >>
> >>
> >> --
> >> Jim Kiley
> >> Senior Technical Consultant | Summa
> >> [p] 412.258.3346
> >> http://www.summa-tech.com
> >>
> >
> >
>



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


Re: Struts2 Bean Setter Attack

2009-06-30 Thread Jim Kiley
Why worry if an object at your view layer gets a value set on it?  Your real
processing should be occurring at a service layer underneath the view layer.
 Only copy data from the view down into your application if you really need
for it to be copied down.
jk

On Tue, Jun 30, 2009 at 6:40 PM, smart acer  wrote:

> We need an object for example CustomerData in session. We have configured
> it
> through struts2 xml, session scope.
>
> Base Action class has a getter and setter for this bean. getCustomerData(),
> setCustomerData()
>
> Since it has a setter on action class (setter is needed to put it on
> session
> thru struts2), we believe it is open to object setter attack through Form
> Post. One can for example post with customerData.address and struts2 would
> automatically set this data on the object. This attribute is suppose to be
> READ ONLY or ONLY System can set it, not from UI.
>
> Any idea how we can prevent this issue? I am surprised this kind of
> security
> issue is there with struts2, what are we missing? Is there a interceptor we
> need to configure to prevent this?
>
> Thanks
>



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


Re: adding values to a variable inside iterator tag

2009-06-29 Thread Jim Kiley
You're far better off doing it inside the Action class.
That said, you can probably use s:set to get what you want.

jk

On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma wrote:

> Hi,
> I have a simple iterator tag like the following
>
> 
>
>
>
> 
>
> is there a way to get the total of value1 at the end of this iterator tag?
>
> basically in java we would do totalValue += value1; and then at the end of
> the loop we would have total of value1.
>
> Is that possible to do with an iterator tag?
>



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


Re: Interceptor Use

2009-06-27 Thread Jim Kiley
This is a very appropriate use for interceptors.
You might also want to look at Spring Security, which does this and a lot
more without too much configuration pain.

jk

On Sat, Jun 27, 2009 at 12:25 PM, Robin Mannering wrote:

> Hello,
>
> Struts 2.1.6
>
> I wish to ensure a user is logged into an application before allowing
> him/her to execute certain tasks.
>
> Would using an Interceptor be a good way to go?
>
> My idea is to retrieve session data in the intercept() method of the
> interceptor and verify a certain attribute is held in the session.
>
> If it is not, I would then like to redirect the user to a login page with
> an appropriate error message.
>
> Is this an approriate use of interceptors?  Previously, I simply had a
> verifyLoginStatus() method in a base action class which I extended in
> actions I wanted to protect.
>
> I'd appreciate any thoughts...
> Thanks
> Robin
>
> -
> 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: prepare{MethodName} not working

2009-06-27 Thread Jim Kiley
Reread what I wrote:
"You probably have the @Override annotation on prepareSave(), and *you don't
need it*."

Delete the annotation.

jk

On Sat, Jun 27, 2009 at 11:52 AM, Praveen.V.Kumar <
praveenkuma...@spanservices.com> wrote:

> I have the @Override annotations on prepareSave() but still it is saying
> The method prepareSave() of type ManageGeneralSetupAction must override or
> implement a supertype method
>
> -----Original Message-
> From: Jim Kiley [mailto:jhki...@summa-tech.com]
> Sent: Saturday, June 27, 2009 9:20 PM
> To: Struts Users Mailing List
> Subject: Re: prepare{MethodName} not working
>
> You probably have the @Override annotation on prepareSave(), and you don't
> need it.
>
> On Sat, Jun 27, 2009 at 11:40 AM, Praveen.V.Kumar <
> praveenkuma...@spanservices.com> wrote:
>
> > Hi,
> >
> > While referring the below link I came to know that we can have
> > prepare{MethodName}() that will run before the invocation of the
> particular
> > method.
> >
> > http://struts.apache.org/2.1.6/docs/prepare-interceptor.html
> >
> > I was trying the same. In my action class, I have a save() method and the
> > action class is implemented with Preparable Interface. But when I add
> > prepareSave() I get a error
> > "The method prepareSave() of type ManageGeneralSetupAction must override
> or
> > implement a supertype method".
> >
> > Do I need to override any other method or do I need to implement any
> other
> > Interface?
> >
> > Please advice me on this.
> >
> > Thanks
> > Praveen
> >
> >
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>
> -
> 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: prepare{MethodName} not working

2009-06-27 Thread Jim Kiley
You probably have the @Override annotation on prepareSave(), and you don't
need it.

On Sat, Jun 27, 2009 at 11:40 AM, Praveen.V.Kumar <
praveenkuma...@spanservices.com> wrote:

> Hi,
>
> While referring the below link I came to know that we can have
> prepare{MethodName}() that will run before the invocation of the particular
> method.
>
> http://struts.apache.org/2.1.6/docs/prepare-interceptor.html
>
> I was trying the same. In my action class, I have a save() method and the
> action class is implemented with Preparable Interface. But when I add
> prepareSave() I get a error
> "The method prepareSave() of type ManageGeneralSetupAction must override or
> implement a supertype method".
>
> Do I need to override any other method or do I need to implement any other
> Interface?
>
> Please advice me on this.
>
> Thanks
> Praveen
>
>


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


Re: Struts2 - freemarker error

2009-06-25 Thread Jim Kiley
Please for the love of all that is good in the world don't actually post all
that.

On Thu, Jun 25, 2009 at 5:52 PM, Martin Gainty  wrote:

>
> please post all jsp pages, all freemarker template code ,all java code and
> configuration
> files of applicationContext.xml, decorators.xml, dwr.xml, sitemesh.xml
> tiles.xml,validation.xml, web.xml,
> struts-actionchaining.xml,struts-ajax.xml
> , struts-chat.xml, struts-conversion.xml, struts-filedownload.xml,
> struts-fileupload.xml
> , struts-freemarker.xml, struts-hangman.xml, struts-integration.xml
> , struts-interactive.xml, struts-jsf.xml, struts-model-driven.xml,
> struts-person.xml
> ,struts-tags-non-ui.xml, struts-tags-ui.xml, struts-tags.xml,
> struts-tiles.xml
> ,struts-token.xml,struts-validation.xml, struts-wait.xml
> , struts-xslt.xml,struts.xml, as well as all properties files of
> globalMessages.properties,globalMessages_de.properties,globalMessages_fr.properties
> ,log4j.properties,*Action.properties,*-conversion.properties
>
> so we may better help you determine your problem
>
> (please feel free to re-post if i missed any items)
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung
>
> 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.
>
>
>
>
>
>
> > From: kishanchellapaand...@spanservices.com
> > To: user@struts.apache.org
> > Date: Thu, 25 Jun 2009 19:09:07 +0530
> > Subject: Struts2 - freemarker error
> >
> > Hi,
> >
> > I'm using struts 2.1.6, xwork-2.1.2, freemarker 2.3.13, ognl 2.6.11 and
> jboss 5.0.1.
> >
> > I'm having one ftl, where I'm doing the following
> >
> > <#list "${additionalMethods}"?split(",") as additional>
> > <#assign tmpInner>${additional?trim?substring(0,
> additional?trim?index_of(":"))}
> > 
> >
> > But this gives me the following error:
> >
> > Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
> range: -1
> >   at java.lang.String.substring(String.java:1938)
> >   at
> freemarker.core.StringBuiltins$substringBI$1.exec(StringBuiltins.java:213)
> >
> > I checked the length of the string which is 28 and the index_of ":" is 7.
> >
> > Also I tried, ${additional?trim?substring(0, 1)} - this also gives the
> above error.
> >
> > I don't know what the problem here is.
> >
> > Please advice.
> >
> > Thank you.
> > Regards,
> > Kishan.G
> >
> > Team Leader.
> > www.spansystems.com
> >
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
>
> _
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290




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


Re: Generating Dynamic radio button list

2009-06-24 Thread Jim Kiley
You need to provide Struts with an actual List (or Set or the like).  It
looks like you are providing a single String.  You will need to parse that
String out into a List of Strings in order for  to treat it as a
List.
jk

2009/6/24 BlackKnight 

> Hi,
>
> I am trying to generate a dynamic raido buttom list using
>
> 
>
> where optionvalue is stored in database equal
>
> #{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}
>
> however struts2 doesn't generate the radio button list intead he
> generate only 1 radio button with value equals
>
> #{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}
>
> Any help?
>
>
> Thanks!
>
>
> Frank
>
> -
> 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: Exceptions thrown by constructor different from those thown by execute() ?

2009-06-23 Thread Jim Kiley
Presumably the code calling execute() wraps it in a try/catch, but the call
that is instantiating the action in the first place doesn't do that.  You'd
have to look at the source to be sure, but of course that's the nice part
about working on open-source projects.
>From a philosophical perspective, though -- no clue, I don't have a lot of
insight into why the devs make all the decisions they make.

jk

On Tue, Jun 23, 2009 at 5:12 AM, Jan T. Kim  wrote:

> On Tue, Jun 23, 2009 at 06:41:48AM -0200, Pawe? Wielgus wrote:
> > Hi Jan,
> > i'm not going into details of your solution but interceptors are a way
> > better tool for that job, search the list for authentication subjects.
> > You can also use libraries like acegi or similiar.
>
> thanks for this pointer, I agree that this is probably a bad example
> as such ad-hoc development of authentication mechanisms isn't really
> a good idea.
>
> My question is about exception handling in general, though: Why does
> my handler work as expected when the exception is thrown by execute(),
> but not when it's thrown by the constructor?
>
> Having run into this, I'd like to understand it before moving on.
>
> Best regards, Jan
>
> > 2009/6/22, 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
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
>
> --
>  +- 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
>
>


-- 
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 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: Struts2 and Security

2009-06-19 Thread Jim Kiley
Hi Farshad,
I hope you don't mind that your direct email to Todd went to the whole list.

jk

On Fri, Jun 19, 2009 at 8:02 PM, Farshad Rabbani  wrote:

>
> Hi Todd,
>
>
>
>  I hope you don't mind that I am emailing you directly.  I am
> about to start work on an immigration project for Belize using Struts2.  I
> am new to struts but wanted to use it for this project.  I am using MySQL
> for my database and have 30+ tables.  I also have a table for users,
> password etc.  However, after reading your post, I became very interested in
> using jsecurity instead of having to worry about implementing authentication
> etc. myself.  I have downloaded the zip file from the URL you provided.
>  However, I was wondering if it is possible that I see some sample of your
> app where you actually use jsecurity with struts2.  I am clueless about how
> to combine jsecurity with struts and also how to incorporate it with my
> existing database etc.  I usually learn better by seeing a working example
> where I can adapt ideas of it to suite my needs.  If it is not too much
> trouble, could you send me some aspects of your struts2 project where you
> used jsecurity?  I would appreciate your help greatly.  Thank you for any
> assistance you can provide.
>
>
>
> Kind Regards,
>
> Farshad Rabbani
>
>
>
>
> > Subject: RE: Struts2 and Security
> > Date: Fri, 19 Jun 2009 08:27:38 -0500
> > From: tkoff...@ku.edu
> > To: user@struts.apache.org
> >
> > I developed an webapp about a year ago, using struts 2 and a security
> > package called (at the time) jsecurity. Since then, jsecurity has become
> > an apache project and has been renamed Apache Ki/Shiro. I guess that
> > there was a naming conflict with the "Ki" name, so it is now called
> > Apache Shiro (as of very recently).
> > http://www.jsecurity.org/ (old independent website)
> > http://incubator.apache.org/ki/ (apache website - probably soon to be
> > renamed shiro)
> >
> > Naming issues aside, this was an excellent security package providing
> > authentication and authorization that was pretty easy to learn,
> > flexible, and very powerful. The support that I received from the
> > project's founders was second to none (Thanks Les & Jeremy!). One of my
> > colleagues here at KU, Bruce Phillips, has also posted some tutorials
> > (linked to from the apache website) to get you started.
> >
> > You should really check into it.
> >
> > Todd Kofford
> > tkoff...@ku.edu
> > University of Kansas - IT
> >
> >
> > -Original Message-
> > From: aum strut [mailto:aum.str...@gmail.com]
> > Sent: Friday, June 19, 2009 2:20 AM
> > To: Struts Users Mailing List
> > Subject: Struts2 and Security
> >
> > 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
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
>
> _
> Windows Live™ SkyDrive™: Get 25 GB of free online storage.
> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009




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


Re: Struts2 and Security

2009-06-19 Thread Jim Kiley
I can't speak in too much depth about JAAS in general, nor about certain
aspects of Acegi, but we've been using Acegi (now Spring Security) in
production with a Struts 2 site for a couple of months and we are very
pleased with the relative ease of implementation.
Without knowing what you want out of a security system I can't really
provide more information.  We're using Spring Security to access a few
simple database tables that provide user authentication and authorization
info.  I haven't tried integrating it with the client's Active Directory
setup yet so I can't speak to clever stuff like that.

jk

On Fri, Jun 19, 2009 at 3:20 AM, 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
>



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


Re: how to prevent users from directly accessing jsp files

2009-06-18 Thread Jim Kiley
Put the JSPs under /WEB-INF/ and refer to them as the destination of your
Struts action results.
jk

On Thu, Jun 18, 2009 at 9:32 AM, abhishek reddy wrote:

> how to prevent users from directly accessing jsp files, rather they have to
> come thru sturts action?
>
> --
> Abhishek
>



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


Re: Struts Flow in JSP,Servlets Project

2009-06-17 Thread Jim Kiley
RTFM is an English acronym best summarized as "please read the
documentation."
By service routines what he means is this:

Instead of writing an Action code that has your DB access code directly in
it, write a service class that has DB access code in it, and have your
actions call the service class's methods.  That lets you reuse the DB access
code, and keeps the processing in the Action class focused on the user
interface.  That makes development and maintenance far easier.

jk

On Wed, Jun 17, 2009 at 2:29 AM, sprani.kmraj wrote:

>
> Dear volker,
>
> Thank you so much.
> This is what i expected... Now i understood the things.
> Can u please tell me that, what you r mean by service routines & RTFM.
>
> U r telling that DB access code should be in Action class, right
> So, where the Prepared statements should be in?
> what are all the things should be there in Servlet & java Bean?
> Please explain.
>
> regards,
> Rani.
>
>
>
>
>
> Volker Karlmeier wrote:
> >
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Hi,
> >
> > 1) your submit button should submit to some action defined in struts.xml.
> > 2) your action class is called (if you have not specified any other,
> > "execute" is called.
> > 3) the result of your action specifies, which jsp is called next
> >
> > your code for accessing the DB should be called in 2) (better call
> > some service routines that access the database).
> >  for more information: RTFM
> >
> > Regards
> >
> >   volker
> >
> > sprani.kmraj schrieb:
> >> Dear All,
> >>
> >> GoodDay...!
> >> Im beginner for Struts programming.
> >> I hv started developing a Struts project.
> >> I have many doubt can u please clarify my doubt
> >> i have a jsp page which contains the input data(name & password).
> >> When i click the submit button, data will have to store in the database.
> >> i usally used to write DB connection code & definition of DB(prepared
> >> Statements) in servlet.
> >> But while using struts Where i have to write the code for DB
> >> connection
> >> & definition...
> >>
> >> When i click the submit button in JSP...
> >> what is the flow in the struts project.
> >> What are all the required files(servlets,java bean,action class,action
> >> form like that...)
> >>
> >> Please tell me the flow
> >> I hv refered many books... but i didnt get the answer to my point
> >
> >
> >
> > -BEGIN PGP SIGNATURE-
> > Version: GnuPG v1.4.7 (GNU/Linux)
> >
> > iD8DBQFKOCfYaEMQXBIqssERAsBiAJ9p5OK8mMT02ENsl9zFd4InzMCKhwCffefs
> > d3wcCN/k+pbpxOHGOgdswXI=
> > =Cwon
> > -END PGP SIGNATURE-
> >
> >
> > -
> > 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-Flow-in-JSP%2CServlets-Project-tp24054020p24067708.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
>
>


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


Re: Save web page as pageName.doc

2009-06-09 Thread Jim Kiley
On Tue, Jun 9, 2009 at 6:25 PM, Dave Newton  wrote:

> Jim Kiley wrote:
>
>> Just for fun I just tried it -- made a trivial HTML file, named it
>> "foo.doc," and double-clicked, and it did open in Word.  Properly
>> formatted
>> and so on too.  Word is happy to open HTML files.  It loves you and it
>> wants
>> you to be happy.
>>
>
> On *your* machine, perhaps. On all my Windows machines an HTML file will,
> by default, open in Firefox, or on a work machine I have no control over,
> IE.


That surprises me, since I had always assumed that Windows based the
application of choice on the file extension.  I wonder what other guidance
is being used.  Content-type?


> This is reasonable behavior: it's a web page, not a word processor
> document. Unless you are controlling deployment, you don't have control over
> what a user's machine will open an HTML file in on a double-click.


This I totally agree with.

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


Re: Save web page as pageName.doc

2009-06-09 Thread Jim Kiley
On Tue, Jun 9, 2009 at 4:31 PM, Dave Newton  wrote:

> Jim Collings wrote:
>
>> It's a report and the requirement I'm trying to satisfy is that you
>> have to be able to save it as a MS Word *.doc file. What I've
>> discovered is that you can take a stand-alone html file (i.e. no
>> external files like images or CSS etc. ) change the file extension
>> from *.html to *.doc and double clicking opens it in Word without any
>> trouble.
>>
>
> Only if your machine is configured to open up HTML files in Word, which
> strikes me as completely bizarre.
>

Just for fun I just tried it -- made a trivial HTML file, named it
"foo.doc," and double-clicked, and it did open in Word.  Properly formatted
and so on too.  Word is happy to open HTML files.  It loves you and it wants
you to be happy.

jk


Re: Iterating over a List of Lists

2009-06-02 Thread Jim Kiley
I had no idea I was in the presence of royalty.

On Tue, Jun 2, 2009 at 10:29 AM, Dave Newton  wrote:

> DavidCAIT wrote:
>
>> My JSP code looks like:
>>
>> 
>>  
>>>  name="myList[%{#outerStat.index}][%{#innerStat.index}].property"/>
>>  
>> 
>>
>
> I did something very similar to this quite some time ago, although it was
> actually a little worse (another layer, the name of one of the properties
> was dynamic) and was crowned the King of OGNL for my efforts.
>
> Maybe search the archives--there shouldn't be an issue doing things like
> this if things are set up right.
>
> Dave
>
> -
> 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: why doesnt iterator tag provide 'next'

2009-05-31 Thread Jim Kiley
I figured. The solution to "I can't solve this problem" is rarely "let's add
a new tag to the framework."
jk

On Sun, May 31, 2009 at 10:08 AM, Dave Newton  wrote:

> Jim Kiley wrote:
>
>> Assuming that you're iterating over a List, why not instead iterate over a
>> List of Integers, and use those Integers as the index to your iterator?
>>  You
>> can increment the counter inside the iterator.  Or if you need to get
>> foo[0]
>> and foo[1] on the first run through, foo[2] and foo[3] on the next run,
>> you
>> could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and
>> dataList [i + 1].  It's easy enough to dynamically generate the List of
>> Integers in your action class.
>>
>
> Yep--that was the "just use the index" bit, but I'm grumpy today and didn't
> feel like spelling it out :)
>
>
> Dave
>
> -----
> 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: why doesnt iterator tag provide 'next'

2009-05-31 Thread Jim Kiley
Assuming that you're iterating over a List, why not instead iterate over a
List of Integers, and use those Integers as the index to your iterator?  You
can increment the counter inside the iterator.  Or if you need to get foo[0]
and foo[1] on the first run through, foo[2] and foo[3] on the next run, you
could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and
dataList [i + 1].  It's easy enough to dynamically generate the List of
Integers in your action class.
jk

On Sun, May 31, 2009 at 9:58 AM, Bhaarat Sharma  wrote:

> sadly in my case i need to :(
>
> But this takes us back, the pseudocode you are suggesting is not possible
> using s:iterate, I dont think we have the ability to move the cursor (or
> current value in top stack) withtin the iterator tag.  Neither does jstl
> provide this.  So sadly, will my code have to sit back in time and use
> scriptlets.
>
> On Sun, May 31, 2009 at 9:49 AM, Dave Newton 
> wrote:
>
> > Bhaarat Sharma wrote:
> >
> >> how would 'if' help with 'next'.  can you please give an example?
> >>
> >
> > Pseudocode Java; this is something people should be able to figure out
> for
> > themselves. In JSP I might just use the index.
> >
> > for (Foo curr : foos) {
> >if (alt) {
> >...
> >} else prev = curr;
> >alt = !alt;
> > }
> >
> > OTOH, I'd probably never *need* to do this.
> >
> >
> > Dave
> >
> > -----
> > 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: [s2] strange (for me) OGNL behavior

2009-05-29 Thread Jim Kiley
Whenever you click an HTML button with your mouse, the browser will submit
the X and Y coordinates of the area that you clicked.  This is to support
image maps.  By giving the submit button a name (I think), the browser tries
to provide those X and Y coordinates with respect to the button's name (thus
name.x and name.y).  Struts is trying to parse those input parameters but
because you probably don't have an object in your action class that has the
name that your submit button has, it is lost.
This error won't actually cause you any real problems, but if you want to
get rid of it I think you'll want to get rid of the 'name' attribute on your
submit button.

jk

On Fri, May 29, 2009 at 5:46 AM,  wrote:

> Hi,
>
> OGNL is a great mystery for me. It does magic and - well - strange things.
> :-)
> Perhaps you can help me out.
>
> The situation:
> I have a S2 (2.16) site where I use on some pages a form like this:
> 
>  
>   name="plzs_submit" cssStyle="margin-left: 5px;" />
> 
>
> This works great.
>
> The problem:
> when pressing the Submit-button, Struts throws exceptions that it (OGNL)
> cannot set the properties x and y which do not exist.
> This does not stop my app from working, its just ugly.
>
> Looking a bit into the problem I found that the form tries to transfer
> plzs_submit.x and plzs_submit.y and this causes the problem.
>
> I am puzzled.
>
> Any explanation and hint for stopping this will be greatly appreciated.
>
> Martin
>
> +---
>  Dipl. inf. Martin Kindler
>  Julius-Leber-Str. 8
>  D-76448 Durmersheim
>
>  Tel. +49 (0)7245 80 48 774
>  GSM +49 (0)160 977 636 14
>
> ---------
> 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: I need to set value in the action class

2009-05-25 Thread Jim Kiley
As a side note to Dave's point, opening a unique database connection within
every execute() method of every action class is an extraordinary waste of
your time, and will make debugging pretty painful.  You'd be much better off
writing a single service object to handle that stuff for you, and call the
service object from your action classes.

On Sun, May 24, 2009 at 9:53 AM, Dave Newton  wrote:

> Prashant Singh wrote:
>
>>   > href="astralpharma/showpdtsupp.action">  > value="productName"/>
>>  
>>
>
> There are a few ways to do it; here's two.
>
> 
>  
>
>  
>
>  
>
>  
>  
>
>  
> 
>
> All of these topics are covered in the Struts 2 documentation, which I'd
> recommend reading before getting too much further into your project. There
> are at least a couple more variations, but this should be enough to get you
> started.
>
> Dave
>
> -----
> 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: How to keep information when a auto-checked type is done by struts?

2009-05-19 Thread Jim Kiley
You could access category with #session.category if I remember my OGNL
right.   Or you could add a 'category' field to your Action class, with
public getter and setter, and then, instead of putting cat into the session,
you could do this.setCategory(cat) -- and then your JSP would work fine.

On Tue, May 19, 2009 at 11:02 AM, Stefano Tranquillini <
stefano.tranquill...@gmail.com> wrote:

> So,
> i've done this:
> there's a init action that does:
> public String execute() throws Exception {
> Map session = ActionContext.getContext().getSession();
> List cat = mgmt.getAllCategory();
> session.put("category", cat);
> return SUCCESS;
> }
>
> after that a jsp is display:
>
> <%@ taglib uri="/struts-tags" prefix="s" %>
>
> 
> 
> 
>name="category"
>   list="category"
>   listKey="idCategory"
>   listValue="name"
>   multiple="false"
>   headerValue="-- Please Select --"
>   required="true"
>   />
>
>  required="true"/>
> 
> 
> 
> 
>
> but the problem is:
>
> tag 'select', field 'list', name 'category': The requested list key
> 'category' could not be resolved as a
> collection/array/map/enumeration/iterator type. Example: people or
> people.{name} - [unknown location]
>
> ideas?
>
>
> On Sat, May 9, 2009 at 14:19, Stefano Tranquillini
>  wrote:
> >
> >
> > On Sat, May 9, 2009 at 00:49, Dave Newton  wrote:
> >>
> >> Stefano Tranquillini wrote:
> >>>
> >>> i've a form. i've some field that are double type. if i put a string
> inside
> >>> these fileds struts automatically check the incorrectness of the type.
> ok!
> >>> but, inside this form i've a select that is created by a list.
> >>> when the error comes out from struts, sruts goes back to the input
> page,
> >>> the list become empty and in the page no item is display.
> >>>
> >>> how can i store the list in order to have its inside my page after the
> >>> error?
> >>
> >> You could store it in session, you could implement Preparable and load
> the list. There are probably a few other reasonable solutions--those are
> what popped in to my head first.
> >
> > a ok, i thought about the same solution.
> >
> >>
> >>> PS: if i set required="true" at a field, struts doesn't check if this
> value
> >>> is present or not? what meaning has this property?
> >>
> >> From the documentation:
> >>
> >> "If set to true, the rendered element will indicate that
> >> input is required"
> >>
> >> It displays a required indicator.
> >
> > so only display a * near the label
> >>
> >> Dave
> >
> > ciaociao
> >
> >
> > --
> > Stefano
>
>
>
> --
> 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: Disabling JSP's

2009-05-15 Thread Jim Kiley
Put the JSP under /WEB-INF -- it is accessible to Struts routing but not
directly viewable by end clients.
jk

On Fri, May 15, 2009 at 2:36 PM, Timothy Orme
wrote:

> Hello All,
>
>I'm in the process of migrating pages from JSP's using snippets to
> struts actions. I'm wondering how people have disabled access to JSP's so
> that they cannot be accessed outside of the action anymore.
>Right now if I have an action like:
>
>
>/private/index.jsp
>
>
>There is nothing preventing the user from just browsing directly to
> /private/index.jsp instead of accessing it through the Action URL. This
> could have some bad implications about security, but also might just look
> bad if a page that should be receiving data from an action no longer has the
> source.
>
>How have people worked around this in the past?
>
> -Tim Orme
>
>
> -
> 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: Problem dispatching in /content dir

2009-05-15 Thread Jim Kiley
If you're using annotation-based results, and you extend ActionSupport, the
dummy action class is just a few lines -- it has no class body at all.
jk

On Fri, May 15, 2009 at 9:53 AM, Jim Collings  wrote:

> I take it back. I only thought I had it figured out. I'll use the
> dummy action. I find it distasteful but it seems the best way.
>
>
> Jim C.
>
> On Fri, May 15, 2009 at 9:07 AM, Jim Kiley  wrote:
> > What I've done in this situation is put in the dummy action.  Inevitably
> I
> > find myself needing some kind of pre-processing before the JSP is loaded
> up
> > -- even when I don't initially believe that I will -- and the dummy
> action
> > is the right place for it.
>
> -
> 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: Problem dispatching in /content dir

2009-05-15 Thread Jim Kiley
What I've done in this situation is put in the dummy action.  Inevitably I
find myself needing some kind of pre-processing before the JSP is loaded up
-- even when I don't initially believe that I will -- and the dummy action
is the right place for it.
jk

On Fri, May 15, 2009 at 7:40 AM, Jim Collings  wrote:

> Here's a bit of clarification:
>
> page-one.jsp which is in /content
> |
> \-page-two  <--Have to use this to access page two because
> it, also is in "/content". This means calling an empty "execute()".
>  |
>  \-page-two.jsp
>   |
>   \page-two  <--Page two action "page-two!dosomething"
>
> Now I could put in a dummy action that just forwards to "page-two.jsp"
> but why? It seems like there should be a better way.
>
>
> Jim C.
>
> On Fri, May 15, 2009 at 7:16 AM, Jim Collings  wrote:
> >
> > So I have a jsp that needs to submit to another jsp. Both are in
> /content. When I use file-name.jsp I get 404. When I use file-name, I get
> the action that file-name.jsp submits to.
> >
> > Any ideas on how I can work around this?
> >
> > Jim C.
>
> ---------
> 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: struts2+spring+hibernate, objects instantiate order?

2009-05-14 Thread Jim Kiley
1) is correct.  I can't tell you the number of times that, on app startup,
I've gotten reams and reams of error messages because Spring couldn't
instantiate some bean or another.2) is both -- which you could determine for
yourself pretty easily by putting a logging statement in the action's
constructor.

jk

On Wed, May 13, 2009 at 10:03 PM, ren sky  wrote:

> 1) before running my project, spring has already instantiate all the
> object defined in the applicationContext.xml?
>   such as LoginAction,PersonServiceImpl and sessionFactory?
> 2) the action  used in struts2 is instantiated before a request comes
> in? or is instantiated  when a real request comes in?
> 3) with spring,what is the role of struts2 ? it seems that the
> responsibility of instantiate object is changed to spring, not
> struts2.
>
> thanks.
>
> -
> 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: default class to forward requests

2009-05-12 Thread Jim Kiley
It is ActionSupport.
When you don't have access to a book you may find that you get faster
results from Google[1] or the introductory documentation[2] than the mailing
list.

jk
[1]
http://www.google.com/search?rlz=1C1GGLS_enUS291US303&sourceid=chrome&ie=UTF-8&q=struts+2+action+class+execute+success+default
[2]http://struts.apache.org/2.1.6/docs/hello-world.html

On Tue, May 12, 2009 at 11:15 AM, Bhaarat Sharma wrote:

> Is there a default class that we can use in struts.xml that can be used for
> just forward request to a new html page.
> Basically user clicking a link and going to a new page.  I dont want to
> make
> an execute method that just returns SUCCESS.  Rather there must be some
> default class that does that.  I read about it in a struts2 book, however,
> dont have that book with me right now for reference.
>
> Does someone know what the class is called?
>



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


Re: How do I get a request header

2009-05-12 Thread Jim Kiley
ServletRequestAware?
jk

On Tue, May 12, 2009 at 9:03 AM, Jim Collings  wrote:

> Hmmm... So there isn't already an HeaderInterceptor?  Seems odd.
>
>
> Jim C.
>
> On Tue, May 12, 2009 at 8:54 AM, Struts Two  wrote:
>
> >
> > Here is one way I did to get "Authorization" value in the header:
> >
> > 1- Define an interceptor that retrieves "HttpServletRequest"
> > 2- Define an interface ,say HeaderAware.
> > 3- In your interceptor retrieve related values from Header and then
> inject
> > it into your action if it implements "HeaderAware.
> >
> > That should do it.
> >
> > --- On Tue, 5/12/09, Jim Collings  wrote:
> >
> > > From: Jim Collings 
> > > Subject: Re: How do I get a request header
> > > To: "Struts Users Mailing List" 
> > > Received: Tuesday, May 12, 2009, 12:40 PM
> > > I am also trying to retrieve an item
> > > in the header so that I can place it in
> > > the value stack.  Any ideas on how best to accomplish
> > > this?
> > >
> > > Jim C.
> > >
> > > On Tue, May 12, 2009 at 8:37 AM, Norris Shelton <
> norrisshel...@yahoo.com
> > >wrote:
> > >
> > > > I looked in the interceptors and did not see one that
> > > pulled the heders.
> > > >
> > > >
> > > > Norris Shelton
> > > > Software Engineer
> > > > Sun Certified Java 1.1 Programmer
> > > > Shelton Consulting, LLC
> > > > ICQ# 26487421
> > > > AIM NorrisEShelton
> > > > YIM norrisshelton
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >   __
> > Looking for the perfect gift? Give the gift of Flickr!
> >
> > http://www.flickr.com/gift/
> >
> > -
> > 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: Please help! Struts 2/Eclipse - List Object is not displaying in JSP

2009-05-07 Thread Jim Kiley
The checkstyle, FindBugs, or PMD plugin does this for sure.

On Thu, May 7, 2009 at 8:50 PM, Dave Newton  wrote:

> SofIAm wrote:
>
>> Thank YOU ALL! What a dumb JAVA 101 mistake! I was never populating the
>> class
>> member variable myList, but the local one in my method, unintentionally of
>> course. DUH!!! It's working like a charm!  Thanks again!
>>
>
> There is a warning available in Eclipse to notify you when a local variable
> shadows a property. (I think.)
>
> Dave
>
>
> -
> 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: Please help! Struts 2/Eclipse - List Object is not displaying in JSP

2009-05-07 Thread Jim Kiley
Even then it won't be OK.  The OP is declaring myList as a local variable in
getAllEmployees(), so getMyList won't return it.  Change the line "List
myList = new ArrayList();" in getAllEmployees() to just be "myList =
new ArrayList();" and do as Lukasz suggests and you should be OK.
jk

On Thu, May 7, 2009 at 11:57 AM, Lukasz Lenart  wrote:

> 2009/5/7 SofIAm :
> >public String getAllEmployees() {
>
> This method is never called, renamed it to execute() and should be ok
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> 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: action call getting skiped

2009-05-04 Thread Jim Kiley
Just re-forwarding your message to the list won't necessarily improve the
chances of its being responded to.  Your message is hard to read and
understand.  That is probably why no one responded to it in the first place.
It seems likely that the problem does not lie in your interceptor stack but
rather in your action code or in your JSP.  Can you please confirm that the
unit tests you wrote for your action code validate that your action code
functions as designed?

jk

On Mon, May 4, 2009 at 4:26 PM, srinivasa_v .  wrote:

> -- Forwarded message --
> From: srinivasa_v . 
> Date: Mon, May 4, 2009 at 11:45 AM
> Subject: action call getting skiped
> To: Struts Users Mailing List 
>
>
>  Hi ALL,
> I have list of emp details,I need to click on one of emp record,it will
> call
> an action class get the details from db display on the form,and edit the
> details and when i click on
> submit ,it will call an action calss where in
>  based on DOB i need to redirect to  and action
> say if age is <18 ,
> i need to go to   page ,where in I will have Yes and no button,if user
> clicks
> on yes,it goes to action class ,and  call  manager class BO ,and update
> detils in DB
> and call return back to action and goes to sucess page.
> for the first  time its working fine ,
> when I try to udate the same emp details again, same record
> age is <18
> it will go to yes and no page ,when I click on yes now instead of  going to
> action class,
> it is direcly going to sucess page,
>
>  class="com.dh.action.client.EMPCRUDAction">
>   
>
> 
>
>  
>  
>  
>  
> 
> 
>   
>2,3
>  
>  ../common/Confirm.jsp
>  ../common/Error.jsp
>  ../common/success.jsp
>  
>
>
> This a production issue for me ,
> and this is occcuring when I try to go thru www.balbal.com, and in
> production iam going thru F5,
> and its working fine if I direcly access my  ipaddress,
> and we have another module in prodution which is based on purely on
> servlets
> and jsp ,having  similar flow ,
> and its working fine .
>
> is any of the interceptors having  cache problem
>
>
>
>
> regrads.
>



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


Re: How to develop a Wireframe using Struts UI?

2009-04-30 Thread Jim Kiley
The members of this mailing lists are users and volunteers; they are not
very likely to take a lot of their personal time to provide  step-by-step
instructions based on an image file.  Specific questions are welcome but
general queries like this are not liable to get the detailed response that
you are hoping for.

jk

On Thu, Apr 30, 2009 at 11:40 AM, kunduruswaroop wrote:

>
>
>
> Please see the UI drawing below and let me know the steps to follow to
> develop a wireframe.  I need a expand and collapse version too as shown
> picture below.
>
> http://www.nabble.com/file/p23318872/Temp1.PNG Temp1.PNG
>
>
>
>
> Thanks in advance.
>
> Regards,
>
> Swaroop Kunduru
> --
> View this message in context:
> http://www.nabble.com/How-to-develop-a-Wireframe-using-Struts-UI--tp23317576p23318872.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
>
>


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


Re: pagination in struts2

2009-04-23 Thread Jim Kiley
Lots of possibilities here:* you need to have a class named TestList in your
application
* you need a constructor for your TestList class that accepts an int and a
boolean as its arguments
* you need to be sure you are appropriate importing the reference to
TestList in your JSP

On Thu, Apr 23, 2009 at 11:36 AM, Stefano  wrote:

> when i put
> <% request.setAttribute( "test", new TestList(2, false) ); %>
>
> netbeans said: cannot find construtcto TestList(int,bool)
>
> and the application goes in a exception:
>
> org.apache.jasper.JasperException: Unable to compile class for JSP:
>
> An error occurred at line: 1 in the jsp file: /jsp/shop/shop.jsp
> TestList cannot be resolved to a type
> 1: <% request.setAttribute( "test", new TestList(2, false) ); %>
> 2: <%@ taglib uri="/struts-tags" prefix="s" %>
> 3:
> 4:
>
> idea?
>
>
> 2009/4/23 André Diniz :
> > It's just a sample pages...
> >
> > 2009/4/22 Dave Newton 
> >
> >> http://displaytag.sourceforge.net/1.2/tut_externalSortAndPage.html
> >>
> >> It pays to really spend some time looking over existing documentation;
> it's
> >> often quicker than waiting for someone on a list or forum to answer.
> >>
> >> Dave
> >>
> >>
> >> Bhaarat Sharma wrote:
> >>
> >>> jim,
> >>>
> >>> I found this example
> >>>
> >>>
> >>>
> http://displaytag.homeip.net/displaytag-examples-1.2/example-paging.jsp?d-49653-p=1
> >>>
> >>> it says "Ok, you have made a query that returns you back a list of 120
> >>> elements, but you don't want to show the user all 120 items at once,
> you
> >>> want to allow them to page through the results (pretend 120 is really
> 1200
> >>> or 12000)."
> >>>
> >>> they are iterating through a long 12000 record list and then just
> putting
> >>> that into pages.  What I was looking for was something that would show
> 50
> >>> results of 12000 on first page then when NEXT is cliked, it against
> goes
> >>> to
> >>> DB to get next 50 records.
> >>>
> >>>
> >>>
> >>> On Wed, Apr 22, 2009 at 4:22 PM, Jim Kiley 
> >>> wrote:
> >>>
> >>>  I found this within thirty seconds of clicking Dave's link:
> >>>> http://displaytag.sourceforge.net/1.2/tut_sources.html
> >>>>
> >>>> Note that the contents of this page are actually fairly freakin'
> horrible
> >>>> and should not be done on a grownup application.  But the instructions
> >>>> are
> >>>> right there and easy to find.
> >>>>
> >>>> jk
> >>>>
> >>>> On Wed, Apr 22, 2009 at 4:18 PM, Bhaarat Sharma 
> >>>> wrote:
> >>>>
> >>>>  I wanted to use it for the purpose so that when I click NEXT or 2nd
> page
> >>>>> then again I go to the DB to fetch next set of 50 records.
> >>>>>
> >>>>> but didnt see any examples of that sort
> >>>>>
> >>>>> On Wed, Apr 22, 2009 at 4:13 PM, Dave Newton 
> >>>>> wrote:
> >>>>>
> >>>>>  Stefano Tranquillini wrote:
> >>>>>>
> >>>>>>  someone has experience with this tag?
> >>>>>>>
> >>>>>>> i don't really understand how it works.
> >>>>>>>
> >>>>>>>  What issues are you having? There are a number of tutorials and
> >>>>>>
> >>>>> examples
> >>>>
> >>>>> on
> >>>>>
> >>>>>> the site:
> >>>>>>
> >>>>>> http://displaytag.sourceforge.net/1.2/tut_basic.html
> >>>>>>
> >>>>>> Dave
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> -
> >>>>>> 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
> >>>>
> >>>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> >
> > --
> > André Diniz
> > +55 (41) 9997-5567
> > e-mail alternativo: diniz...@msn.com
> >
>
>
>
> --
> 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: pagination in struts2

2009-04-22 Thread Jim Kiley
I found this within thirty seconds of clicking Dave's link:
http://displaytag.sourceforge.net/1.2/tut_sources.html

Note that the contents of this page are actually fairly freakin' horrible
and should not be done on a grownup application.  But the instructions are
right there and easy to find.

jk

On Wed, Apr 22, 2009 at 4:18 PM, Bhaarat Sharma  wrote:

> I wanted to use it for the purpose so that when I click NEXT or 2nd page
> then again I go to the DB to fetch next set of 50 records.
>
> but didnt see any examples of that sort
>
> On Wed, Apr 22, 2009 at 4:13 PM, Dave Newton 
> wrote:
>
> > Stefano Tranquillini wrote:
> >
> >> someone has experience with this tag?
> >>
> >> i don't really understand how it works.
> >>
> >
> > What issues are you having? There are a number of tutorials and examples
> on
> > the site:
> >
> > http://displaytag.sourceforge.net/1.2/tut_basic.html
> >
> > Dave
> >
> >
> >
> > ---------
> > 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: How to do matematical operation in jsp.

2009-04-21 Thread Jim Kiley
RoundingMode.SUPERMAN_III
On Tue, Apr 21, 2009 at 12:07 PM, Dave Newton  wrote:

> Dave Newton wrote:
>
>> The issue for me would be that if this is money maths it should be using
>> BigDecimal (or something), and I'm not sure what OGNL would do with the '*'
>> operator.
>>
>
> It would multiply the BigDecimals, but using a default MathContext, which
> may or may not give the results you really want.
>
> OTOH, siphoning the $.0039079850466805510222911834716796875
> into offshore accounts will eventually make you rich.
>
> Dave "Expecting his 10% cut" Newton
>
>
>
> -
> 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: How to do matematical operation in jsp.

2009-04-21 Thread Jim Kiley
EVIL, wow, sounds serious.

On Tue, Apr 21, 2009 at 12:02 PM, Lukasz Lenart <
lukasz.len...@googlemail.com> wrote:

> 2009/4/21 Suneel :
> > I'm not sure about this but can't you invoke a function in OGNL. I
> > guess thats how the getText function works in ognl. Probably you can
> > write a function in your action like getResult and invoke it using
> > 
> > Correct me if i'm wrong.
>
> Yes you can do that, but it's EVIL! DON'T DO THAT!!! Business logic
> has to be in your business model, not in a presentation layer!
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> 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: how remain in the same page

2009-04-21 Thread Jim Kiley
Are you recommending testing a user's privileges in the untrusted,
untrustworthy, totally hackable client code?  Really?

On Tue, Apr 21, 2009 at 10:43 AM, elyes sallem wrote:

> of course u make  the test , in a javascript function, in your jsp
>
> Elyes
>
> 2009/4/21 elyes sallem 
>
> > hi Stefano ,
> > in fact , i choosed to back to one page in every case, that's  ok for me
> > if u wanna remain in the same page
> > u can declare a getter for a member in the form
> > let's say test1
> > so in getTest1(){
> > you make the treatment u want
> > and return a boolean resultat  for example
> > if true, u submit to an action else u don't submit
> > and u declare test1 in the jsp page as a hidden field  > property="test1":>
> > like this u can remain in the same page and invoke only your action when
> > the returned result is ok
> >
> > wish i was clear
> >
> > Regards
> > Elyes
> >
> > }
> >
> >
> >
> > 2009/4/21 Stefano 
> >
> > have u solved?
> >>
> >> i've the same issues to do.
> >>
> >>
> >> On Mon, Apr 20, 2009 at 16:29, elyes sallem 
> >> wrote:
> >>
> >> > Hello,
> >> > i have a struts application, which can be used by different user
> profile
> >> > among the profile, there is  one who can access some pages
> >> > so if he try to access to one page , i will diplay a warning message
> in
> >> the
> >> > depart page
> >> > so, i wanna know , after checking the user profile in the action, how
> >> can i
> >> > forward him to the source page, i.e he remains in the same page, and i
> >> will
> >> > display a warning message to inform him that this page is inaccessible
> >> >
> >> >
> >> > Thanks
> >> > Regards
> >> > Elyes
> >> >
> >>
> >>
> >>
> >> --
> >> Stefano
> >>
> >
> >
> >
> > --
> > Elyes.
> >
>
>
>
> --
> Elyes.
>



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


Re: how remain in the same page

2009-04-21 Thread Jim Kiley
There's a number of ways to handle scenarios like this.  An easy one would
be something like this:
Assume you have start.jsp and next.jsp, and StartAction and NextAction.

In StartAction have two results: SUCCESS and NOT_ALLOWED.  SUCCESS goes to
NextAction, NOT_ALLOWED returns to start.jsp.

In the execute() method of StartAction, check the user's credentials.  if
they have the right credentials, return SUCCESS.  if they do not, do
addActionError("you are Not Allowed") and return NOT_ALLOWED.

Another alternative would be to restrict page access with something like
Spring Security, which is overkill if there's only a few pages you need to
manage access to, but darned handy if any more than that.

jk

On Tue, Apr 21, 2009 at 10:31 AM, Stefano  wrote:

> have u solved?
>
> i've the same issues to do.
>
>
> On Mon, Apr 20, 2009 at 16:29, elyes sallem 
> wrote:
>
> > Hello,
> > i have a struts application, which can be used by different user profile
> > among the profile, there is  one who can access some pages
> > so if he try to access to one page , i will diplay a warning message in
> the
> > depart page
> > so, i wanna know , after checking the user profile in the action, how can
> i
> > forward him to the source page, i.e he remains in the same page, and i
> will
> > display a warning message to inform him that this page is inaccessible
> >
> >
> > Thanks
> > Regards
> > Elyes
> >
>
>
>
> --
> Stefano
>



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


Re: struts2 show question

2009-04-20 Thread Jim Kiley
Oh heck I misread your code there.  This is Struts 1 and not Struts 2, isn't
it?  Sorry about that.
jk

On Mon, Apr 20, 2009 at 12:08 PM, Jim Kiley  wrote:

> Have you tried writing a unit test to ensure that testList is populated
> after your action executes?  I'm pretty sure you'll find that it isn't.
> It looks to me like you're declaring testList to be a local variable within
> your action method (you're doing "List testList = " instead of "testList =
> ").  So your local testList goes out of scope as soon as the action method
> is done executing.  You need testList to be a field of your action, not a
> local variable.
>
> jk
>
>
> On Mon, Apr 20, 2009 at 12:01 PM, red phoenix wrote:
>
>> I have a table named mytable,it has two cols,col1 and col2,the data are
>> col1   col2
>> ---
>> John   24
>> Kate   18
>>
>> hibernate xml file is follows:
>> 
>>  
>>  
>>   
>>  
>>  
>>   
>>  
>>   
>> 
>>
>> Then I user struts2 to get the data by following statement: List
>> testList=this.getHibernateTemplate().find(" from mytable");
>> request.setAttribute("testList",testList);
>> return SUCCESS;
>>
>> the action dispatch to following jsp page
>>
>> 
>> 
>>   
>>
>> 
>>   
>> 
>> 
>>
>> Above codes run well,it can show correct result
>>  John   24
>> Kate   18
>>
>> then I modify struts action,like following:
>>  List testList=this.getHibernateTemplate().find(" select col1,col2 from
>> mytable");
>> request.setAttribute("testList",testList);
>> return SUCCESS;
>>
>> the action dispatch to the same jsp,but this time,the jsp show nothing!
>> Why? I don't understand what's wrong with my code? Anyone could help me to
>> solve above problem?
>>
>> Thank
>>
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>



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


Re: struts2 show question

2009-04-20 Thread Jim Kiley
Have you tried writing a unit test to ensure that testList is populated
after your action executes?  I'm pretty sure you'll find that it isn't.
It looks to me like you're declaring testList to be a local variable within
your action method (you're doing "List testList = " instead of "testList =
").  So your local testList goes out of scope as soon as the action method
is done executing.  You need testList to be a field of your action, not a
local variable.

jk

On Mon, Apr 20, 2009 at 12:01 PM, red phoenix  wrote:

> I have a table named mytable,it has two cols,col1 and col2,the data are
> col1   col2
> ---
> John   24
> Kate   18
>
> hibernate xml file is follows:
> 
>  
>  
>   
>  
>  
>   
>  
>   
> 
>
> Then I user struts2 to get the data by following statement: List
> testList=this.getHibernateTemplate().find(" from mytable");
> request.setAttribute("testList",testList);
> return SUCCESS;
>
> the action dispatch to following jsp page
>
> 
> 
>   
>
> 
>   
> 
> 
>
> Above codes run well,it can show correct result
>  John   24
> Kate   18
>
> then I modify struts action,like following:
>  List testList=this.getHibernateTemplate().find(" select col1,col2 from
> mytable");
> request.setAttribute("testList",testList);
> return SUCCESS;
>
> the action dispatch to the same jsp,but this time,the jsp show nothing!
> Why? I don't understand what's wrong with my code? Anyone could help me to
> solve above problem?
>
> Thank
>



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


Re: Struts.properties question

2009-04-17 Thread Jim Kiley
If you have any power over the data, you should change that so that you are
not getting the SSN as an integer.  It's not a number in any sense of the
word except that it has digits.  You never do math on it.  Save it as a
String if you can.

On Fri, Apr 17, 2009 at 4:20 PM, Bhaarat Sharma  wrote:

> great!
>
> it worked out for me.
>
> One last question, I was looking at the wiki but it seems like formatting
> is
> only available for numbers and dates.
>
> is it possible to format an SSN?
>
> I am getting the SSN as an integer. but would like to show it as
> ###-##-
>
> On Fri, Apr 17, 2009 at 10:54 AM, Terry Gardner  >wrote:
>
> >
> > On Apr 17, 2009, at 10:49 AM, Bhaarat Sharma wrote:
> >
> >  so I can create this new property file in the same folder where my
> >> struts.properties file resides or does it have to be in the package
> where
> >> action is.
> >>
> >
> > Good point. I forgot to mention that there is a search hierarchy. I
> usually
> > put the properties
> > files in the same directory as the action, but they can also be "up the
> > chain". So, if my Action class is
> > com.slamd.struts2.actions.SlamdStartServerResultAction.java,
> > then I put the SlamdStartServerResultAction_en.properties file in
> > com/slamd/struts2/actions.
> >
> >
> >> so if my action name is XXX.java the property file will be
> >> XXX_en.properties
> >> and the properties file will be picked automatically or does it require
> >> any
> >> changes in struts.properties? does it have to be registered there?
> >>
> >
> > Picked automagically by getText(). Remember to change the "_en" part to
> the
> > two letter code for the language. I only speak English - and that badly -
> > so mine are all
> > "_en" for the moment.
> >
> >
> >
> >> Thanks!!
> >>
> >> On Fri, Apr 17, 2009 at 10:44 AM, Terry Gardner  >> >wrote:
> >>
> >>  The resource bundles can also be in files named after the Action, for
> >>> example, SlamdStartServerResultAction_en.properties, which contains
> keys
> >>> and
> >>> values (English) for the Action SlamdStartServerResultAction.java
> >>>
> >>>
> >>> On Apr 17, 2009, at 10:36 AM, Bhaarat Sharma wrote:
> >>>
> >>> I  know we can a property file in struts like this
> >>>
> >>>>
> >>>> struts.custom.i18n.resources=nameofFile
> >>>>
> >>>> But is there a way to use multiple properties files? (nameofFile)
> >>>>
> >>>> we have a lot of labels for our application and if we put everything
> >>>> into
> >>>> one property file then it seems to get so overwhelmingly huge that its
> >>>> hard
> >>>> to find anything in it.
> >>>>
> >>>> Is there a way to over come this problem?
> >>>>
> >>>>
> >>>
> >>> -
> >>> 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
> >
> >
>



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


Re: Is there a way to make Struts2 working with other methods different than classic getter/setter?

2009-04-17 Thread Jim Kiley
You can do that right out of the box.  I do it all the time.  Give it a try.
Create method with those names, and reference them in JSPs by those names.
 It should work.
jk

On Fri, Apr 17, 2009 at 9:31 AM, Federica Oltolina <
federica.oltol...@ubiquity.it> wrote:

> Hi all,
> my head office yesterday asked me if it's possible to declare
> in some special file a mapping between actions and their methods
> because he'd like to use custom getter/setter methods containing some
> little formatting operations.
>
> For example, for the action attribute:
> /
> private String bankingCode;/
>
> he liked having in our action more than one getter that would sound like:
>
> /getBankingCodePrecedeedByAnyZero();
> getBankingCodePrecedeedByFiveZero();
> and so on...
>
> /and then in the jsp that corresponds to the action cited above ho would
> Struts2 to be able
> to understanding the correct setter/getter method, for example he'd like to
> write
>
> /...
> 
> ...//
> /
> obtaining the result of the method /getBankingCodePrecedeedByAnyZero();
>
> /Someone knows if there is a way to do this?
> No matter if this sounds like a swearword for a Struts2 good user
> or if this is not smart, he asked me this.
>
> Thanks in advance
> Federica
>
>


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


Re: Storing interface instance in a user's session

2009-04-16 Thread Jim Kiley
If you use SessionAware in your actions, you can receive a Map that
represents the session.  You could pass that Map into your user manager
class, and do the storage that way.

On Thu, Apr 16, 2009 at 10:18 AM, Security Management <
list-subscripti...@secmgmt.com> wrote:

> I want to store a list of interface instances (i.e. UserImpl which
> implements IUser), so I can have methods:
>
> public void setUser(List users)
> {
>This.getSession().put(SESSION_USER_LIST_KEY, users);
> }
>
> public List getUsers()
> {
>return (List) this.getSession().get(SESSION_USER_LIST_KEY);
> }
>
> I'm using Spring to manage struts objects.  Can someone help, I'm having
> trouble with finding out how in the documentation.  Maybe my google
> keywords
> are bad or something...
>
>
> -
> 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: Validation - Simple Theme

2009-04-15 Thread Jim Kiley
Customizing the textfield in the xhtml theme takes about seven minutes.
 Really.

2009/4/15 André Diniz 

> How to validate my forms using simple theme?
>
> I can't see the message errors
>
>  - - - x - - -
>
> I'd like to create my text fields side-by-side using ajax or xhtml themes,
> how can I do that? I have to customize a theme to do that? Oh my! How come?
> Minus bonus points for Struts...
>
> André.
>



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


Re: RE: Global tag settings?

2009-03-24 Thread Jim Kiley
Is there a reason you couldn't just overwrite the textfield tag with a
custom theme?

On Tue, Mar 24, 2009 at 5:23 PM, carlo latasa  wrote:

> I'm not sure I understand what you are getting at but this is what I'd like
> to do:
>
> At the moment all of my textfield tags render with labelposition=top - the
> default. I'd like to make a global setting for all textfield tags such that
> the labelposition=left. Instead of having to call it out in every tag on
> every page (thousands in my case).
>
> All other parameters for all other tags could use the default labelposition
> - unless I specified otherwise in say the struts.xml;)
>
> Make sense?
>
>
> On Mar 24, 2009 12:02pm, Martin Gainty  wrote:
> >
> > if you think labelPosition attribute should have a global default then
> you
> may want to update Struts 2 JIRA
> > but
> > in the case of labelPosition each struts tag is placed in different
> locations
> > so having a global default of labelPosition="top" is orthogonal
> > as setting each and every struts tag labelPosition would still have to be
> > done for each declared tag in the form
> > Is there a practical use case for this scenario?
> >
> > Martin
> > __
> > Disclaimer and confidentiality note
> > This message is confidential and may be privileged. If you are not the
> intended recipient, we kindly ask you to please inform the sender. Any
> unauthorised dissemination or copying hereof is prohibited. This message
> serves for information purposes only and shall not have any legally binding
> effect. Given that e-mails can easily be subject to manipulation, we can
> not
> accept any liability for the content provided.
> >
> >
> >
> >
> >
> >
> > > Date: Tue, 24 Mar 2009 13:02:18 -0400
> > > Subject: Re: Global tag settings?
> > > From: jhki...@summa-tech.com
> > > To: user@struts.apache.org
> > >
> > > I don't know of any way to set those values globally for the
> application,
> > > but this isn't something I have put a lot of time into. This is the
> right
> > > list to ask questions on, but if you get no response by the second or
> third
> > > question it probably means that the folks reading don't know offhand
> and
> may
> > > not have time to find the answer.
> > > jk
> > >
> > > On Tue, Mar 24, 2009 at 12:55 PM, carlo latasa clat...@gmail.com>
> wrote:
> > >
> > > > So is this the wrong list to post a question? or is this a RTFM
> issue?
> > > >
> > > > On Mon, Mar 23, 2009 at 4:47 PM, carlo latasa clat...@gmail.com>
> wrote:
> > > >
> > > > > So should I post this to :
> > > > > https://issues.apache.org/struts/secure/Dashboard.jspa ??
> > > > >
> > > > > going once, going twice???
> > > > >
> > > > > can anyone tell me where the defaults are even set? I've looked
> through
> > > > the
> > > > > struts-core jar with no luck.
> > > > >
> > > > >
> > > > > On Mon, Mar 23, 2009 at 1:57 PM, carlo latasa clat...@gmail.com>
> wrote:
> > > > >
> > > > >> org.apache.struts2.views.jsp.ui.SelectTag.labelPosition=right
> > > > >>
> > > > >> or
> > > > >>
> > > > >> org.apache.struts2.components.Select.labelPositioin=right
> > > > >>
> > > > >> don't work either.
> > > > >>
> > > > >> So does the default struts.properties file included in the struts
> jar
> > > > >> define all the possible keys/values that can be set at runtime?
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > >>
> > > > >>
> > > > >> On Fri, Mar 20, 2009 at 12:04 PM, clat...@gmail.com> wrote:
> > > > >>
> > > > >>> Hello,
> > > > >>>
> > > > >>> Is there any way to set common tag parameters like
> labelSeparator,
> > > > >>> labelposition etc.. in say the struts.properties file?
> > > > >>>
> > > > >>> I've tried struts.tag.labelposition, struts.ui.tag.labelposition.
> > > > >>>
> > > > >>> thanks,
> > > > >>>
> > > > >>> Carlo
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlo Latasa
> > > > Cell: (415) 385-1567
> > > >
> > >
> > >
> > >
> > > --
> > > Jim Kiley
> > > Senior Technical Consultant | Summa
> > > [p] 412.258.3346
> > > http://www.summa-tech.com
> >
> > Express your personality in color! Preview and select themes for
> Hotmail®.
> See how.
> >
>



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


Re: Global tag settings?

2009-03-24 Thread Jim Kiley
I don't know of any way to set those values globally for the application,
but this isn't something I have put a lot of time into.  This is the right
list to ask questions on, but if you get no response by the second or third
question it probably means that the folks reading don't know offhand and may
not have time to find the answer.
jk

On Tue, Mar 24, 2009 at 12:55 PM, carlo latasa  wrote:

> So is this the wrong list to post a question? or is this a RTFM issue?
>
> On Mon, Mar 23, 2009 at 4:47 PM, carlo latasa  wrote:
>
> > So should I post this to :
> > https://issues.apache.org/struts/secure/Dashboard.jspa ??
> >
> > going once, going twice???
> >
> > can anyone tell me where the defaults are even set? I've looked through
> the
> > struts-core jar with no luck.
> >
> >
> > On Mon, Mar 23, 2009 at 1:57 PM, carlo latasa  wrote:
> >
> >> org.apache.struts2.views.jsp.ui.SelectTag.labelPosition=right
> >>
> >> or
> >>
> >> org.apache.struts2.components.Select.labelPositioin=right
> >>
> >> don't work either.
> >>
> >> So does the default struts.properties file included in the struts jar
> >> define all the possible keys/values that can be set at runtime?
> >>
> >
> >
> >
> >>
> >>
> >> On Fri, Mar 20, 2009 at 12:04 PM,  wrote:
> >>
> >>> Hello,
> >>>
> >>> Is there any way to set common tag parameters like labelSeparator,
> >>> labelposition etc.. in say the struts.properties file?
> >>>
> >>> I've tried struts.tag.labelposition, struts.ui.tag.labelposition.
> >>>
> >>> thanks,
> >>>
> >>> Carlo
> >>
> >>
> >>
> >>
> >>
> >
>
>
> --
> Carlo Latasa
> Cell: (415) 385-1567
>



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


Re: ClassCastException com.dev.model.Form cannot be cast to java.lang.String

2009-03-24 Thread Jim Kiley
Look at your execute() method or whatever method you're calling from your
JSP.  I suspect that you are returning a com.dev.model.Form object instead
of a String like "success" or "input".
jk

On Tue, Mar 24, 2009 at 11:26 AM, foward  wrote:

>
> Hello,
>
> I don't know if I m right posting here this, but I have this problem with
> my
> webapp and I couldn't find a solution I hope you can help me please:
>
> ERROR [httpSSLWorkerThread-8080-1] ActionComponent.executeAction(259)
> java.lang.ClassCastException: com.dev.model.Form cannot be cast to
> java.lang.String
>at
>
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:409)
> 
>
> I did search looking for an answer but I didnt find nothing... the thing is
> when I call an action method in a view:
>
> 
> 
> Survey :  ${form.name}
> Introduction :  ${form.introduction}
> Close Date: ${form.close_date}
> 
> 
>
> to show information about one Form.
>
> Please if you can guide me to solve this, Thanks in advance!
>
> Best Regards
>
>
>
> --
> View this message in context:
> http://www.nabble.com/ClassCastException-com.dev.model.Form-cannot-be-cast-to-java.lang.String-tp22682861p22682861.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
>
>


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


Re: session

2009-03-23 Thread Jim Kiley
I'm sorry -- English obviously isn't your native language -- I personally
can't make heads or tails of this.
Is your problem that when a user navigates back to your welcome page the
session is lost?  Or that the session isn't lost and you want it to be?  Or
something else entirely?  Is it that you want to force the user to a welcome
page if there isn't already a session (if they aren't already logged in)?

jk

On Mon, Mar 23, 2009 at 6:44 AM, Seshagiri V  wrote:

> Hi All,
>
> 1.  Log in and navigation some more pages.
> 2.  At same address bare used again http://localhost/  it is going to
> welcome page and session not find out because user is already logged in.
> 3.  I am calling  one of actions  then I will getting user is
> there(session)
> 4.  I will approaching without invoke any action
> 5.  Otherwise How will invoke the action go to welcome or index page.
> 6.  Please send any solution
>
>
>
>
>
>
>
> Thank you,
>
> Seshagiri V
>
> seshagi...@kensium.com.
>
>
>
> US Main: 877 KENSIUM (536.7486)
>
> US Fax:   312.242.3029
>
>
>
> Kensium
>
> 200 S Wacker Dr, Suite 3100
>
> Chicago, IL 60606
>
>
>
> Confidentiality Note:
>
> -
>
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
>
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
>
>
>
>
>
>


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


Re: Parameters in URL

2009-03-19 Thread Jim Kiley
I'm having an extremely hard time understanding what you are asking here.  I
think you may have been trying to paste something into your message but
failed to paste it in, or something.  Can you be clearer about what you are
asking for?
jk

On Thu, Mar 19, 2009 at 12:34 PM, cheeran  wrote:

>
> I use struts 2.1.6, follow both struts.properties and includeParams="none".
> The paramter in action class comes as
>
> valuea, valueb where valueb is the default form value. I use sx:a to assign
> a target to the link. Any other reason ? I use this in a  tab panel tab
> page.
>
> Thanks,
> Santhosh
>
> --
> View this message in context:
> http://www.nabble.com/Parameters-in-URL-tp15485039p22603523.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
>
>


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


Re: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Jim Kiley
Dave's right -- a good choice here is to keep that kind of data in a server
settings config file, and set up your application to pull the database
context info out of the JNDI context.  Check out
http://tomcat.apache.org/tomcat-5.5-doc/index.html
<http://tomcat.apache.org/tomcat-5.5-doc/index.html>for
details on this sort of thing.
jk

On Thu, Mar 12, 2009 at 2:50 PM, Security Management <
list-subscripti...@secmgmt.com> wrote:

> OK, my bad, I meant out of the applicationContext.xml
>
> I basically want to be able to tell someone to deploy a war file, edit a
> file outside of the "webroot" that has the settings in it, and startup
> tomcat.
>
> Then, my app would load that properties file and make the connection.
>
>
>
> -Original Message-
> From: Dave Newton [mailto:newton.d...@yahoo.com]
> Sent: Thursday, March 12, 2009 2:40 PM
> To: Struts Users Mailing List
> Subject: Re: Convention for keeping passwords out of struts.xml
>
> Security Management wrote:
> > What's the convention for keeping database settings out of struts.xml?
>
> Hmm, I guess I never even considered putting them in there.
>
> JNDI, Spring, and property files are the obvious choices, most DB
> technologies support creating a datasource in their own config as well.
>
> Dave
>
>
> -
> 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
>
>


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


Re: this is driving me nucking futs!

2009-03-11 Thread Jim Kiley
Musachy, I would refer to you as "a cool dude" if you did that.
jk

On Wed, Mar 11, 2009 at 5:10 PM, Musachy Barroso  wrote:

> That is something I have complained about for a long time, time to do
> something about it I guess.
>
> musachy
>
> On Wed, Mar 11, 2009 at 5:08 PM, Chris Pratt 
> wrote:
> > I guess one question I would ask is why  doesn't have an action
> > paramter and allow nested  elements?  That way there would be no
> > need to create any variables.
> >  (*Chris*)
> >
> > On Wed, Mar 11, 2009 at 1:56 PM, mitch gorman 
> wrote:
> >
> >> Wes Wannemacher wrote:
> >> > On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman 
> >> wrote:
> >> >
> >> >>thanks for your responses, wes!
> >> >>
> >> >>
> >> >
> >> > No problem, next time, include me in your list of gurus and I'll be
> happy
> >>
> >> lol!  you got it!
> >>
> >>(i knew for sure i was probably inadvertently dissing at least a
> >> couple people here... my apologies to any *other* deserving souls!)
> >>
> >
>
>
>
> --
> "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
>
>


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


Re: s:radio and s:checkboxlist - how to customize listValue property.

2009-03-11 Thread Jim Kiley
The easiest (I'm not going to say "best") solution is to make a "fake"
getter on your bean.  Make a "getListLabel()" method that composes a String
from the values that you want to display in the list label, and then set the
listValue to be "listLabel".  This is the way I've done this in the past and
it works OK.  It isn't ideal if you want to keep your model carefully
isolated from your UI but my own designs are a little less pure than that.
jk

On Wed, Mar 11, 2009 at 10:05 AM, boraldo  wrote:

>
> When I use that 2 components in my form I need to set attributes listValue
> and listKey.
> That attributes as I understand require a field of a bean that is a member
> of collection represented by list attribute.
>
> Example:
>
> listKey="id" />
>
> That means:
> 1) there will be one radiobutton for each element of collection getTypes().
> 2) Each html radiobutton will have value = getId()  and label = getName() .
>
> I want to compose label from several fields of my bean. So I can't write
>
>
>
> because that class doesn't have getSomeField() method.
>
> How can I do this ?
> --
> View this message in context:
> http://www.nabble.com/s%3Aradio-and-s%3Acheckboxlist---how-to-customize-listValue-property.-tp22455829p22455829.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
>
>


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


Re: Have a

2009-03-11 Thread Jim Kiley
Can you solve this problem with ?

On Wed, Mar 11, 2009 at 9:07 AM, Ransika de Silva  wrote:

> Yes, your assumption is absolutely correct.
> Thanks for the reply but sadly that technique is not good enough for us, we
> want the label to be a hyperlink.
>
> Regards,
>
> On Wed, Mar 11, 2009 at 6:32 PM, Jim Kiley  wrote:
>
> > ...and so I have to guess that your question is: How can I make a
> hyperlink
> > be the label for a checkbox?  Sometimes it helps to actually ask a
> question
> > in your question.
> > Anyway: Don't have the hyperlink actually be the label per se.  Give the
> > checkbox no label and just put the hyperlink next to the checkbox.
> > jk
> >
> > On Wed, Mar 11, 2009 at 8:55 AM, Ransika de Silva 
> > wrote:
> >
> > > Hi all,
> > > There is a requirement of having a http link as the label of Struts
> > > CheckBox, so the the user can either select the checkbox or click the
> > label
> > > and go to a different page.
> > >
> > > Thanks,
> > > Ransika
> > >
> >
> >
> >
> > --
> > Jim Kiley
> > Technical Consultant | Summa
> > [p] 412.258.3346 [m] 412.445.1729
> > http://www.summa-tech.com
> >
>
>
>
> --
> Ransika De Silva
> SCMAD 1.0, SCJP 1.4,
> BSc.(Hons) Information Systems
>



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


Re: Have a

2009-03-11 Thread Jim Kiley
...and so I have to guess that your question is: How can I make a hyperlink
be the label for a checkbox?  Sometimes it helps to actually ask a question
in your question.
Anyway: Don't have the hyperlink actually be the label per se.  Give the
checkbox no label and just put the hyperlink next to the checkbox.
jk

On Wed, Mar 11, 2009 at 8:55 AM, Ransika de Silva  wrote:

> Hi all,
> There is a requirement of having a http link as the label of Struts
> CheckBox, so the the user can either select the checkbox or click the label
> and go to a different page.
>
> Thanks,
> Ransika
>



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


Re: [OT] Authorization and Authentication Question

2009-03-10 Thread Jim Kiley
I'd agree.  Have your UserDetailsService implementation hit LDAP for
authentication, and pass GrantedAuthorities[] on to the returned object by
asking DB2 about that info if the user is authenticated.
jk

On Tue, Mar 10, 2009 at 6:44 PM, Wes Wannemacher  wrote:

> On Tuesday 10 March 2009 17:56:30 Ashish Kulkarni wrote:
> > HiIs it possible to Authenticate user using LDAP, but authorize using a
> DB2
> > database,
> > I have situation where i need to authenticate and authorize some web
> pages.
> >
> > I want to authenticate users against LDAP, but have to maintain
> > authorization list, roles etc in DB2 database
> >
> > Has anyone done anything like this before, i am using Weblogic and tomcat
> > application servers
> >
>
> I would suggest using Spring Security. I think what you'll need to do is
> create a bean that implements the
> org.springframework.security.userdetails.UserDetailsService interface, then
> wire it into your configuration.
>
> --
>
> 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
>
>


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


Re: HOWTO implement multiple submit buttons with type = image.

2009-03-10 Thread Jim Kiley
With image type submits, an "x" and "y" value are usually submitted (so that
if the button is an imagemap, the server knows where the user clicked).
 Struts is complaining that you don't have any fields that accept an "x" or
a "y" field on your action class.
jk

On Tue, Mar 10, 2009 at 2:46 PM, Kra, Aime yao (TEK System) <
ak...@allstate.com> wrote:

> Hello
>
> I am implementing a form with two buttons CANCEL and REGISTER.
>
> I have followed the sample provided in the cookbook
> http://struts.apache.org/2.x/docs/multiple-submit-buttons.html
> This works fine if type="submit"
>
>
> ---
>   name="buttonName" value="Cancel" />   src="../images/button/register_bkgd.jpg" name="buttonName"
>  value="Register" /> 
>
> ---
>
> For type="image" I receive the following error
> [3/10/09 9:05:49:726 EDT] 0036 ParametersInt E
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
> 'buttonName.x' on 'class com.ars.claims.view.action.CreateProviderOwner:
> Error setting expression 'buttonName.x' with value
> '[Ljava.lang.String;@7cf47cf4'
>
>
> In struts 1, we can use an ImagebuttonBean type to provide the
> getter/setter in the action class. (See
> http://www.java-samples.com/showtutorial.php?tutorialid=518)
>
> I can't see ImagebuttonBean in struts 2.
> Can someone know how to implement these two image type submit buttons and
> What should be the code in the Execute() method of the Action class to know
> the pressed button ?
>
> Any Help will be appreciated.
>
>
> Thanks
>
> Aimé Kra
>
>
>


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


Re: How to render fields horizontally.

2009-03-10 Thread Jim Kiley
 

On Tue, Mar 10, 2009 at 9:21 AM, Kra, Aime yao (TEK System) <
ak...@allstate.com> wrote:

> Hello
>
> I am a new user of struts 2 and want to know how to force struts to render
> two fields on the same line.
> All my fields are rendered vertically even when I use html  to
> organize the fields positioning.
>
> Any sample will be appreciated.
>
> Thanks.
>
>
> Aimé Kra
>
>
>


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


Re: Access ActionForm methods/varaibles in JSP

2009-03-05 Thread Jim Kiley
I suggest that you not embed Java code in JSPs in scriptlets like this.
 It's better to use Struts tags instead.
Are you looking at using Struts 1 or Struts 2?

jk

On Thu, Mar 5, 2009 at 3:22 PM, Emi Lu  wrote:

> Good morning,
>
> In JSP file, may I know how to get action bean please?
>
> 
>   <%
>  if(f1.getCode().equals('abc'))
>  {
>
>   %>
>  ... ...  
>   <%
>  }
>   %>
> 
>
>
>
> In JSP, I'd like to know how to call "methods, fields" in action form bean?
>
> Thanks a lot!
> --
> Lu Ying
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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


Re: Struts Themes Problem - help

2009-03-03 Thread Jim Kiley
If I am understanding you correctly, your best bet might be to customize the
fielderror.ftl template for a custom theme of your own.  If I were going to
display errors in a custom way more than once, that's what I would do.

Make a "template" directory in the root of your webapp, then make a new
folder that has the name you want to give your template. (Mine is cleverly
named "my".)  Then copy fielderror.ftl out of the struts jar into
webapp/my/fielderror.ftl, then customize the contents of fielderror.ftl.

jk

On Tue, Mar 3, 2009 at 5:53 AM, sajidbigler  wrote:

>
> As said below is that a only solution or can we set theme=xhtml for
> fielderror tag with in the   form which uses theme= simple.
>
> but we will be rendering error after the filed not the above as xhtml
> does.how can we make it to render it above the field instead below the
> field?
>
> 
>clientname
> 
> --
> View this message in context:
> http://www.nabble.com/Struts-Themes-Problem---help-tp18054982p22306342.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
>
>


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


Re: Struts 2 - After validation failure populating the drop downs

2009-03-02 Thread Jim Kiley
In your action class, write a method like so:
public String input() {
// populate my dropdowns
return Action.INPUT;
}

Obviously you will have to write the code to populate your dropdowns there,
as that depends on what you are up to.  But the input() method of your
action class will be called if validation fails, so if you have things that
you want to make sure occur on validation failure, put them there.

jk

On Mon, Mar 2, 2009 at 1:30 PM, Sundararaman, Anand <
anand.sundarara...@ps.net> wrote:

> Hi,
>  Would you able to specify in little more detail? Sorry for that as I am
> new to Struts 2.
>
> Thanks,
> Anand
>
>
> -----Original Message-
> From: Jim Kiley [mailto:jhki...@summa-tech.com]
> Sent: Monday, March 02, 2009 12:23 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 - After validation failure populating the drop downs
>
> Populating the dropdowns in an input() method that returns Action.INPUT
> should do the trick.
> jk
>
> On Mon, Mar 2, 2009 at 1:19 PM, Sundararaman, Anand <
> anand.sundarara...@ps.net> wrote:
>
> > Hi,
> >  I guess there is an elegant solution for this but I could not find out
> in
> > the user list.
> >
> > I am using Struts 2 and creating some form validations. If a validation
> > fails on a JSP screen, the input result takes back the control to the
> same
> > screen, but the drop downs are not populated. I need to know the best way
> of
> > showing the validation failures and also populating the drop downs.
> >
> > Thanks a Lot,
> >
> > Anand
> >
> >
> > ---------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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


Re: Struts 2 - After validation failure populating the drop downs

2009-03-02 Thread Jim Kiley
Populating the dropdowns in an input() method that returns Action.INPUT
should do the trick.
jk

On Mon, Mar 2, 2009 at 1:19 PM, Sundararaman, Anand <
anand.sundarara...@ps.net> wrote:

> Hi,
>  I guess there is an elegant solution for this but I could not find out in
> the user list.
>
> I am using Struts 2 and creating some form validations. If a validation
> fails on a JSP screen, the input result takes back the control to the same
> screen, but the drop downs are not populated. I need to know the best way of
> showing the validation failures and also populating the drop downs.
>
> Thanks a Lot,
>
> Anand
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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


Re: Struts 2 question about validation and forwarding

2009-02-27 Thread Jim Kiley
Just have the result of the input() method return them to a different page
under that condition.

On Fri, Feb 27, 2009 at 12:41 PM, laredotornado wrote:

>
> Hi,
>
> If request validation fails, how can I forward the user to a different page
> than that from which they came?  The scenario is that an external web site
> is going to invoke our site with something like
> "/ourForm.do?param1=xxx¶m2=" and if their parameters are not valid,
> we want to forward them to another page on our site.
>
> Thanks for your help, - Dave
>
> --
> View this message in context:
> http://www.nabble.com/Struts-2-question-about-validation-and-forwarding-tp22250708p22250708.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
>
>


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


Re: value truncated

2009-02-26 Thread Jim Kiley
My uncle had his value truncated back in the war.  He doesn't like to talk
about it much.
Oh your actual question.  Have you tried escaping the quote marks?  Using \"
instead of just " ?

jk

On Thu, Feb 26, 2009 at 3:47 PM, Dravid  wrote:

>
> Any thoughts
>
> thanks in advance
>
>
> --
> View this message in context:
> http://www.nabble.com/value-truncated-tp22211336p22233327.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
>
>


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


Re: s:checkboxlist

2009-02-26 Thread Jim Kiley
The way I solved this was to add my own theme, and change the xhtml theme's
"checkboxlist" template to match what I wanted 'my' checkboxlist to do.
Under the root of your web app, add a directory named "template".  Under
"template" add a directory called "myapp".  Then copy checkboxlist.ftl out
of the Struts jar into template/myapp, and modify it as you wish.  Finally,
in your JSP, do 

This comes up fairly often -- I am happy to add it to the FAQ if someone can
tell me how I do that.
jk

On Thu, Feb 26, 2009 at 5:46 AM,  wrote:

>  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px;
> }Hallo,
>  is there any way to set that all items (checkboxes) in
> s:checkboxlist are in their own line, one checkbox under other.
>  Defaultly they are all on the same line and I cannot find the way
> how to set that each one checkbox has to have their own line :-(
>  Thanks, Jiri
>



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


Re: migration of Struts

2009-02-23 Thread Jim Kiley
It is OK to add features to your 1.2.6 app if it is otherwise running OK.
Upgrading to 1.3.10 might not be too painful.  Upgrading to 2.1.6 isn't an
upgrade; it's a rewrite.  There are vast differences.

jk

On Mon, Feb 23, 2009 at 4:27 PM, Ashish Kulkarni <
ashish.kulkarn...@gmail.com> wrote:

> HiI have inherited a struts 1.2.6 application, i need to add some features
> to this web application.
>
> what will be the best migration policy to latest version of Struts without
> lot of efforts,
>
> Should i migrate it to struts 1.3.10 or to latest version 2.1.6?
>
> Is there any documentation for this migration to 1.3 or 2.1 version
>
> I am using myeclipseide for coding, does this version support 2.1.6?
>
> I don't want to put a lot of efforts in migration, but concentrate on
> adding
> this new function
>
> is it ok to add features using 1.2.6 struts?
>
> any advice
>



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


Re: Errors repopulating the list after validation.

2009-02-19 Thread Jim Kiley
)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInt
> > erceptor.java:235)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDr
> > ivenInterceptor.java:89)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(S
> > copedModelDrivenInterceptor.java:128)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(Prof
> > ilingActivationInterceptor.java:104)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu
> > ggingInterceptor.java:267)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn
> > terceptor.java:126)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn
> > terceptor.java:138)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
> > FilterInterceptor.java:87)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto
> > r.java:148)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon
> > figInterceptor.java:164)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep
> > tor.java:128)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex
> > ceptionMappingInterceptor.java:176)
> >
> >
> >
> >
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
> >
> >
> >
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
> >
> >
> >
> >
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
> > a:395)
> >
> >
> >
> > It seems like the countries object has been poped off of the value stack
> > during the validation firing, any ideas how to fix this??
> >
> >
> >
> > The tag is as follows:
> >
> >
> >
> >  > emptyOption="true" required="true"
> >
> >list="countries" listKey="code" listValue="name"
> label="Country"
> > >
> >
> >
> >
> > thanks,
> >
> > Sid Bhatia
> > "Try not. Do...  or do not. There is no try" -- Yoda
> > _
> > *  <mailto:sidharth.bha...@lehman.com> mailto:sidharth.bhat...@gmail.com
> >
> >
> >
> >
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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


Re: [S1]struts with hibernate

2009-02-10 Thread Jim Kiley
t; at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
> at java.lang.Thread.run(Thread.java:595)
>
>
> saludos
> lalchandra rampersaudVI Conferencia Internacional de Energía Renovable,
> Ahorro de Energía y Educación Energética
> 9 - 12 de Junio 2009, Palacio de las Convenciones
> ...Por una cultura energética sustentable
> www.ciercuba.com
>



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


Re: [s2] @Result annotation and namespace parameter

2009-02-04 Thread Jim Kiley
And of course the magic of sending my problem to the mailing list let me
figure out the solution on my own:
I should have been using ServletActionRedirectResult rather than
ServletRedirectResult.

jk

On Wed, Feb 4, 2009 at 10:03 AM, Jim Kiley  wrote:

> I'm feeling dim this morning and I hope you folks can help me out.
> To simplify, I have two classes:
>
> com.company.view.cust.my.order.FieldRepAction
> com.company.view.cust.my.rep.ChooseCustomerAction
>
> FieldRepAction has the following annotation:
>
> @Result(value = "chooseCustomer!input.action",
> type = ServletRedirectResult.class,
> params={"namespace", "/cust/my/rep"})
>
> But when I navigate to fieldRep.action and get redirected, I get a
> beautiful Tomcat stack trace from Struts 2:
>
> There is no Action mapped for namespace /cust/my/order and action name
> chooseCustomer
>
> It seems that I have the wrong "namespace" parameter in the @Result
> annotation.  Can someone point me in the direction of a fix?
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>



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


[s2] @Result annotation and namespace parameter

2009-02-04 Thread Jim Kiley
I'm feeling dim this morning and I hope you folks can help me out.
To simplify, I have two classes:

com.company.view.cust.my.order.FieldRepAction
com.company.view.cust.my.rep.ChooseCustomerAction

FieldRepAction has the following annotation:

@Result(value = "chooseCustomer!input.action",
type = ServletRedirectResult.class,
params={"namespace", "/cust/my/rep"})

But when I navigate to fieldRep.action and get redirected, I get a beautiful
Tomcat stack trace from Struts 2:

There is no Action mapped for namespace /cust/my/order and action name
chooseCustomer

It seems that I have the wrong "namespace" parameter in the @Result
annotation.  Can someone point me in the direction of a fix?
-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


Re: [S2] Passng a parameter with (multiple) Submit buttons

2009-02-02 Thread Jim Kiley
How bout:



Delete

On Mon, Feb 2, 2009 at 11:37 AM, Greg Lindholm  wrote:

>
> Yes Musachy, that is correct.  So is there some struts magic to do this?
>
> The only way I can think of doing this is to add some javascript to each
> button that would set the id as a hidden parameter before doing the submit.
> But I would prefer to do this without JS if possible.
>
> I guess what I'm thinking of would be an enhancement to the submit tag to
> allow passing an "id" in the same way you can pass the Action and Method.
>
>
> Musachy Barroso wrote:
> >
> > What you need to do is pass a different parameter on each submit, not
> > call a different method.
> >
> > musachy
> >
> > On Mon, Feb 2, 2009 at 11:06 AM, Greg Lindholm 
> > wrote:
> >>
> >> Thanks Miguel, but that doesn't sound workable with an arbitrary number
> >> of
> >> buttons.
> >>
> >> Anyone else?
> >>
> >> I'm looking for a method of dealing with a table with each row having a
> >> "remove" button. I need to pass a different rowId based on which button
> >> is
> >> clicked so I know which row to remove.
> >> I need to use a form (not a link) as there are other input fields that
> >> need
> >> to be submitted with the request.
> >>
> >> Is there a struts pattern for this?
> >>
> >>
> >>>
> >>> On Fri, Jan 30, 2009 at 15:54, Greg Lindholm 
> >>> wrote:
> >>>> I have a CRUD action and jsp page for an entity, this entity has a
> list
> >>>> of attributes. I display these attributes in a table one per row.
> >>>> What I would like to do is have a 
> >>>> button
> >>>> on each row of the table so the user can click on the button to remove
> >>>> the attribute.
> >>>> In order to make this work I would need to pass the id of the
> attribute
> >>>> with the submit button and I can't find a way to do this.
> >>>>
> >>>> Is there a (struts) way to pass a parameter with a submit button?
> >>>>
> >>>> I can't use a link because I need all the other form fields to be
> >>>> posted
> >>>> with the request.
> >>>>
> >>>> The only way I can think of making this work is to add some javascript
> >>>> to
> >>>> each button that would set the id in a hidden field before the submit.
> >>>> Is
> >>>> there a pure struts or better way to do this?
> >>>>
> >>>
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-S2--Passng-a-parameter-with-%28multiple%29-Submit-buttons-tp21756353p21793012.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
>
>


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


Re: Struts 2 session problem

2009-01-19 Thread Jim Kiley
Are there frameworks that handle this situation differently?  It's a
browser-side issue, so it isn't clear to me how a server-side framework
could solve it.
jk

On Mon, Jan 19, 2009 at 3:02 PM, Greg Lindholm  wrote:

>
> Oh I fully understand this is a issue with how browsers deal with sessions.
> However these are the browsers our apps have to work with so as a developer
> I have to make the apps work with them and I expect any decent app
> framework
> to have good solutions to all the common use cases. And I consider having
> multiple windows/tabs open to the same app a very common use case.
>
> If some other framework (like SEAM) is handling this issue better then let
> see if we can implement the same solution in Struts 2.
>
> Correction: In my last post I meant to say "Conversation token"  not
> "Session token".
>
>
> Rubbinio wrote:
> >
> > This is not really a struts 2 issue but a browser issue. This is the way
> > firefox persists sessions. If you try same thing in IE6 it will work
> fine,
> > IE7 some times and IE8 fully emulates firefox.
> >
> > Furthermore you can try this with gmail and you will see the same
> > behaviour. This is a fairly well known "limitation" of firefox if you
> want
> > to call it a limitation, I for one think this is the correct thing to do,
> > and since even IE8 starts doing this looks like it is.
> >
> > The solution for FF is to use profiles. Just google for 'Firefox multiple
> > sessions.
> >
> > -Original Message-
> > From: Greg Lindholm [mailto:glindh...@yahoo.com]
> > Sent: January 19, 2009 2:19 PM
> > To: user@struts.apache.org
> > Subject: Re: Struts 2 session problem
> >
> >
> > +1
> >
> > I find I need this all the time when developing; I want to login as 2
> > different users and test multi-user interactions.  Currently I'm forced
> to
> > use 2 different browsers, login once with Firefox and once with IE.
> > This works for development but wouldn't be an acceptable answer for users
> > (plus many work places dictate the browser you will use and don't allow
> > "users" to install other browsers.)
> >
> > Fortunately the only thing I store in the session is a Login object with
> > user credentials and preferences etc.  so this allows a user to have
> > multiple browser windows open to the same application, they share the
> same
> > session (this is the more common use case.)
> >
> > I have a harder time coming up with a legitimate use case for allowing an
> > ordinary user to be logged into 2 different accounts at the same time.
> > (I'm
> > sure that there are legitimate cases but they are more fringe.)
> >
> > On the other hand, if you use "conversation scope" wizards etc. in your
> > app
> > I would expect a user to be able to have a separate conversation in each
> > open window (shared session) without stomping on each other.  This would
> > mean the conversation state could not be stored in the session unless it
> > is
> > identified with a particular window/tab/frame etc. (a session token could
> > be
> > used in a hidden field).
> >
> >
> >
> >
> > newton.dave wrote:
> >>
> >> dusty wrote:
> >>> Creating a separate subsystem on the server to partition a single HTTP
> >>> session for multiple users and maintain the conversation is classic
> >>> overengineering.   Seems like Seam has gone to a lot of trouble to
> >>> provide
> >>> just another way to persist state.
> >>
> >> It's not "over-engineering" to allow multiple tabs per user, each having
> >> their own state--some applications benefit from this functionality, for
> >> several different reasons. I bet if you gave it some thought you'd be
> >> able to come up with several trivial examples of when and why you'd need
> >> this functionality.
> >>
> >> Dave
> >>
> >>
> >> -
> >> 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-2-session-problem-tp21513305p21549675.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------

Re: struts 2 howto mulitiple dynamic buttons in a form

2008-12-11 Thread Jim Kiley
If nothing else, the error message tells you that you aren't closing your
s:property tag.  You have  and you should
have .
jk

On Thu, Dec 11, 2008 at 6:42 PM, Ruel Loehr  wrote:

> Guys,
>
>
>
> I've just started working with struts 2 but I am beating my head against
> a problem.
>
>
>
> I have a jsp which displays a number of rows by using an iterator.   In
> each of those rows, I want a delete button.  When the user clicks one
> of the delete buttons I kick off an action which will get the id to
> delete and delete it.   I am stumped by how to do this!
>
>
>
>
>
> I tried following the code here:
> http://struts.apache.org/2.x/docs/html-form-buttons-howto.html
>
>
>
> But it throws an error saying
>
>
>
> javax.servlet.ServletException: /viewReleases.jsp(21,36) According to
> TLD, tag s:property must be empty, but is not
>
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:5
> 15)
>
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:422)
>
>
>
>
>
> My code  jsp code is:
>
>
>
> 
>
>  value="delete" />
>
>
>
>
>
>
>
> How in the world can i get a value found through an iterator into my
> action class??
>
>
>
> Thanks!
>
>
>
> Ruel
>
>


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


Re: Getter Method call twice - S2

2008-12-04 Thread Jim Kiley
The getter for a given property will get called once every time the page
requests the property.

On Thu, Dec 4, 2008 at 10:45 AM, Eugenio Perrotta Neto <
[EMAIL PROTECTED]> wrote:

> Hi all.
>
> I nedd a very urgent help.
>
> I dont know why when i use tiles or use Tag files whith struts 2, my getter
> methods in the action class are been calling twice.
> Anybody could help me?
>
> Sorry, my english is not very good
>
> --
> Eugenio Perrotta Neto
> Tel: (27) 9913-8080
>



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


Re: How to get last requested page?

2008-11-25 Thread Jim Kiley
Dan,
I would include some kind of parameter with the request that gives your
application a clue as to what path it should follow.  Then use the value of
that parameter to determine which route to respond with.  I think this is
superior to just relying on the name of the JSP or something like that,
because it better decouples your Java code from your presentation layer.

jk

On Tue, Nov 25, 2008 at 8:07 AM, Dan <[EMAIL PROTECTED]> wrote:

> I know this question is more related to java by itself more than to struts,
> but need some help :)
>
> I have to re-use a method in a class, and then depending on from which jsp
> page comes, forward to one jsp or another:
> Page1.jsp (globalForward to method.do)   endpage1.jsp
> \
>/
> > INPUTMethod.do  (if request comes from page1)  OUTPUT >
> / ( if request comes from page2)
> Page2.jsp  (globalforward to method.do)  \endpage2.jsp
>
>
> Is any method that tells me the last request jsp? Or how could i manage
> this situation?
>
> Thanks in advance.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: disable a button if not selected any value

2008-10-24 Thread Jim Kiley
This is a pure Javascript activity -- it isn't something that Struts can
directly help you with.

On Fri, Oct 24, 2008 at 11:46 AM, Dravid <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I have a dropdown box and and delete button on my jsp page.
>
> I have a requirement where user selects a value from dropdown box to delete
> it.
>
> If nothing is selected from the dropdown box then the delete button should
> be disabled.
> on selected it should be enabled.
>
> please help me how to do this.
>
> thanks in advance.
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/disable-a-button-if-not-selected-any-value-tp20152579p20152579.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Struts2 Data Transfer

2008-10-09 Thread Jim Kiley
;>> defined
> >>> in the respective beans.
> >>>
> >>>
> >>> i tied this and is working fine but i want that i should seperate the
> >>> getter
> >>> and setter from my action
> >>>
> >>> i am using model driven approach and it is filling one beans accurately
> >>> but
> >>> i can not fill the second beans in the same getModel() .
> >>>
> >>> any other approach so that i can fill thm at the same time once my
> action
> >>> get called .
> >>>
> >>> On Thu, Oct 9, 2008 at 3:46 AM, Laurie Harper <[EMAIL PROTECTED]>
> >>> wrote:
> >>>
> >>> Just do what Dave outlined in his previous reply. You need
> getter/setters
> >>>> in your action for each bean ([gs]etBean1(), [gs]etBean2() to
> correspond
> >>>> with Dave's JSP sample code) and everything should work. Have you
> tried
> >>>> it?
> >>>>
> >>>> L.
> >>>>
> >>>>
> >>>> aum strut wrote:
> >>>>
> >>>> the issue is i have a registration from in the UI  which have two
> >>>>> different
> >>>>> section in a single page.
> >>>>>
> >>>>> 1) User login Information
> >>>>> 2)Address Information
> >>>>>
> >>>>> i want that these two sections should get populated in two different
> >>>>> Bean
> >>>>> by
> >>>>> the interceptor
> >>>>> that mean User login fields get Pouplated in the UserLogin Beans
> while
> >>>>> the
> >>>>> Address section should  get populated in the Address Bean when my
> >>>>> Registration Action get called once user will hit the Register
> Button.
> >>>>>
> >>>>>
> >>>>> Thanks
> >>>>> -aum
> >>>>>
> >>>>>
> >>>>> On Tue, Oct 7, 2008 at 10:59 PM, Dave Newton <[EMAIL PROTECTED]>
> >>>>> wrote:
> >>>>>
> >>>>> --- On Tue, 10/7/08, aum strut wrote:
> >>>>>
> >>>>>> i need to transfer data from the user registration page to
> >>>>>>> the java beans to be used for inserting values in the data base.
> >>>>>>> i have created two seperate beans for this 1) for storing user
> >>>>>>> address field and second is for storing user login information.
> >>>>>>>
> >>>>>>> i want that when user cllick on the REgister button these
> >>>>>>> two Beans get filled with the respective  values from the UI.
> >>>>>>> i have named the corresponding fields in the beans with respect
> >>>>>>> to the fields name in the UI.
> >>>>>>>
> >>>>>>> What, precisely, is the issue?
> >>>>>>
> >>>>>> If you have a form containing:
> >>>>>>
> >>>>>> 
> >>>>>> 
> >>>>>>
> >>>>>> each bean will contain whatever was entered in the form.
> >>>>>>
> >>>>>> Dave
> >>>>>>
> >>>>>>
> >>>>>>
> -
> >>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> -
> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
>



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


Re: session based pojo as form variables

2008-09-21 Thread Jim Kiley
On Sat, Sep 20, 2008 at 4:46 PM, 928572663 <[EMAIL PROTECTED]> wrote:

>
> The Tag Reference doc:
>
> http://struts.apache.org/2.0.11.1/docs/submit.html
>
> doesn't have much detail about what to expect:  "Set method attribute."  Is
> my pageForward() method supposed to conform to a certain signature?
>

Yup.  It should accept no arguments, and return a String.  Er, and be
public:
public String pageForward() {
//...
}

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


Re: Query

2008-09-21 Thread Jim Kiley
You're going to need to provide a lot more detail if you want a useful
answer of any kind.

On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 <[EMAIL PROTECTED]>wrote:

>
> how we use grids in struts
> --
> View this message in context:
> http://www.nabble.com/Query-tp19591765p19591765.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Performance and High CPU utilization

2008-09-18 Thread Jim Kiley
What kind of server are you using here, how much memory, what CPU -- when we
are getting to CPU utilization, all of these issues are relevant.

On Thu, Sep 18, 2008 at 3:43 PM, sajanv007 <[EMAIL PROTECTED]> wrote:

>
> I have tried all the tuning parameters mentioned in the link somehow CPU
> utilization is always 80% ,I observed that it takes tags are rendered from
> free marker cache but still the cpu 80-90% .
>
> Regards
>
> Sajan
>
>
> Nils-Helge Garli wrote:
> >
> > Maybe this can help:
> > http://struts.apache.org/2.0.11.2/docs/performance-tuning.html
> >
> > Nils-H
> >
> > On Thu, Sep 18, 2008 at 9:11 PM, sajanv007 <[EMAIL PROTECTED]>
> wrote:
> >>
> >> There is huge performance issue and CPU hogging with Struts2 tag , this
> >> was
> >> observed while rendering JSP. These are some performance results
> obtained
> >>
> >> Strut 2 Tag - With all performance tuning applied as per Struts 2
> >> documentation - Freemarker caching etc...
> >> Load Runner Tool
> >> 40 users
> >> 900 hits per second
> >> 10 transaction per second
> >>
> >> Results
> >> CPU utilization 90%
> >> Response 3.5 sec
> >>
> >> Replaced some of Struts2 Tag , with Custom JSP Tags like (s:label,
> >> s:text,s:textfield,s:hidden,s:param)
> >> 40 users
> >> 900 hits per second
> >> 15 transaction per second
> >>
> >> Results
> >> CPU utilization 70%
> >> Response 2.0 sec
> >>
> >> Some where down the line Struts 2 tag are very cpu hungry , to people to
> >> adopt to strut2 framework cpu utilization should be optimized .
> >>
> >>
> >> Did anybody come across on how to over come this problem
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Performance-and-High-CPU-utilization-tp19559123p19559123.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Performance-and-High-CPU-utilization-tp19559123p19560223.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: autowiring in html tag

2008-09-17 Thread Jim Kiley
How would the HTML  tag receive information from your Struts action?
 The  tag is designed to receive that data.  HTML's basic
 tag is not.

On Wed, Sep 17, 2008 at 3:22 PM, MyAshok <[EMAIL PROTECTED]> wrote:

>
> Hi all,
>
> Is it possible to use html tag instead struts 2 tag which should implement
> the autowiring.
> I tried with  instead of  name="username" >.
> I can pass value form jsp to action but not from action to jsp.
> Where i did wrong.
> Please give me the solution ASAP.
>
> With Regards,
> Ashok,
> --
> View this message in context:
> http://www.nabble.com/autowiring-in-html-tag-tp19539274p19539274.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Struts 2.1 Tree Problem

2008-09-11 Thread Jim Kiley
We aren't deliberately ignoring you... many readers of this list are in the
Americas, and you sent your first message after most of us went to bed and
your followup before most of us woke up. :-)
(I have no idea what the answer to your question is, I have not used the
tree control at all -- but what have you tried? Can you share your code with
us so that we can help point you in the right direction?)

jk

On Thu, Sep 11, 2008 at 5:08 AM, Narayana S <[EMAIL PROTECTED]> wrote:

> did any one see this email please help me
>
> On Thu, Sep 11, 2008 at 10:17 AM, Narayana S <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> >now i am working with tree control, when i load the tree i want to
> load
> > it default extended and what ever the node id i pass that should be
> > activated. how i can achieve this using struts 2.1 version. and one more
> > thing is when i select a node in the jsp page itself i have to find out
> the
> > parent of the node selected.
> >
> > please help me to solve this issue, i am kind of stuck..
> >
> > Thanks in advance.
> >
>



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


Re: new to Struts

2008-09-08 Thread Jim Kiley
Start with Struts 2.  It's a great improvement over the old beast.

On Mon, Sep 8, 2008 at 8:25 AM, gbattine <[EMAIL PROTECTED]> wrote:

>
> Hello guys,
> I need an information.
> I'm going to learn struts..
> I need some info, please help me:
>
> 1) what do you hint to me, to start from Struts 1.1 and later move to
> Struts
> 2.0, or starting from Struts 2.0?
> 2) I usually use Netbeans. Is there an editor WYSIWHG for Netbeans, to use
> Struts?
> 3) I know ASP.NET technology and I used lot of already developed
> components,
> like editable grid, dropdown list and so on...does exists such component
> for
> struts?where I can download them?
>
> Thanks,
> Regards
> --
> View this message in context:
> http://www.nabble.com/new-to-Struts-tp19370925p19370925.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: [S2] One hidden value doesn't get submitted (another one does). Why?

2008-09-02 Thread Jim Kiley
Ylva,

You will probably get better results from the list if you can isolate your
problem precisely and describe it more succinctly.

jk

On Mon, Sep 1, 2008 at 1:32 PM, Ylva Degerfeldt
<[EMAIL PROTECTED]>wrote:

> Hi,
>
> My current problem is about a hidden value which isn't saved to the Action.
>
> This is the background information I think is needed:
> The value in question (called "state") is an int property of a POJO
> called "InfoObject". Other relevant properties of the POJO are "id" (a
> String) and "name" (Str.)
> In my application a List of these objects is generated and saved in
> the current HttpSession.
> The action that generates that list calls a JSP which iterates through
> the List (using "#session.nameOfList") and for each object shows
> certain properties and gives the user a chance to change their values
> by using select boxes and buttons (One row equals one object in the
> list).
>
> The thing that isn't entirely working right now is this: In each
> generated row there's an "Edit" button. When the user clicks it, the
> "name" Label (to the left in the row) should change into a TextField
> (so the user can edit it) and stay a TextField until the user clicks
> the "Save" button of that row. This behaviour is controlled by the
> "state" variable of the "InfoObject" (0 means that "name" should be a
> Label and 1 means a TextField).
>
> The corresponding Action of the form that shows this List has get- and
> set properties for the List along with an "index" property. The
> "index" property takes the value of the index of the object in the
> List whose "Edit" button was pushed (e.g. the index of the row).
>
> By the way, this Action always returns to the input page. (I'm having
> another Action for proceeding)
>
> I get this far: When I click an "Edit" button for the first time the
> right index is saved to the "index" property of the Action and I
> change the "state" from 0 to 1 for the corresponding object. Then the
> JSP is rendered again and the "name" value of the corresponding row is
> shown in a TextField instead of a Label which is correct.
> Then I try clicking on the "Edit" button of another row, but when the
> JSP is rendered again the "state" value belonging to the first row has
> changed back to 0 and it's only the "new" row which shows the "name"
> as a TextField.
>
> When I debugged the code I noticed that the "state" value is not
> submitted to the Action (the "setState" method of the objects is never
> called). I have the "state" value as a Hidden field in the form.
> Another hidden field is the "id" field. The weird thing is that the
> "id" field gets submitted though "state" doesn't, and the s:hidden
> tags (and values) have the same structure:
>
> 
> 
>
> I've also searched for spelling errors but have not found any.
> I can add that at first I didn't have a field for "state" in the JSP
> but then I realized that I should have one, so I added the Hidden
> field and did a "Clean and build" of the app.
>
> Another important thing (which May be the cause of this problem but I
> can't tell yet) is that my List is saved in two places (though for a
> short while). I want to keep it in the Session and the first time the
> JSP is shown I have to pick the List from the session
> (#session.MyList), Don't I?
> Then each instance of the Action that is called afterwards gets its
> own copy of the list and (if I understand correctly), if I didn't do
> anything about it, the list would be in two places of the
> ActionContext when the JSP is to be rendered again (in the Session and
> in the Action instance). Though, in my Action I set the Session
> reference to the List (a HttpSession attribute) to point to the List
> instance of the Action (because I want to keep it updated). Could that
> be causing the problem?
>
> I think it would be good if I could reference the List in the JSP Only
> from the Action, but the First time that can't be done (and then I
> Always have to get it from the Session, right?) Is there anyone who
> has made a similar application and can tell me how he/she did it (I
> mean just this "session and Action thing")?
>
> But.. Back at the first problem. I'm not sure if this "list in two
> places" thing is causing the problem but it might be.
> Anyway, I would really appreciate if someone could help me with this!
> (Meanwhile I'll read some more in "Struts 2 in Action" to see if that
> clears up anything.)
>
> Big Thanks in advance!
>
> /Ylva
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Jim Kiley
If each of the buttons is a Submit button, and you have each row of the
table wrapped in a separate form, you can put a  within each form,
and store/provide the ID of the row within it.

jk

On Fri, Aug 29, 2008 at 11:22 AM, Ylva Degerfeldt <[EMAIL PROTECTED]
> wrote:

> Hi everyone,
>
> I have a List of POJOs that I've created, and for every POJO in the
> list I'm displaying some UI components corresponding to the properties
> of the POJO (textfields and select fields et.c.). I also have some
> submit buttons that belong to each row (and indirectly to each POJO),
> like "Edit", "Save" and "Remove" buttons. My corresponding Action has
> a property for the List and it receives its values the way it should.
>
> My problem is that I need some way to tell the Action which of the
> buttons that had been pushed (which one of the "Edit" buttons for
> instance), and I don't know how to do that. To be more exact, I'd like
> some way to return the #state.index of that iteration/row when a
> specific button has been pushed.
>
> I'm also using the "method" tag for calling different methods on the
> Action depending on which of the three buttons that was pushed, so
> that's not a problem.
>
> I've tried to find more information about the s:submit but I didn't
> find anything in "Struts 2 in Action" and the Struts 2 API docs aren't
> explaining much either.
>
> I've tried using the "name" and "value" attributes like for other UI
> components, like:
>
>  "caption.editbutton" method = "Edit"/>
>
> but that only caused the index value to be the caption of the button.
> So it looks like "value" means something else for submit components
> than for other UI components. (It turns into the caption, If a "value"
> is specified..)
>
> I've also checked the parameter names I receive from the action, but
> apart from the different properties of the List I only receive
> "method: Edit" (when an "Edit" button has been pressed). Though I
> recall that when not using Struts you could receive the name of the
> button as a request parameter, so how do I do that with Struts 2 - and
> connect a value to it?
>
> Maybe I could use the "onclick" attribute of s:submit but I don't know
> the syntax for sending a value to the Action there. (Isn't that
> javascript?)
>
> Can somebody please help me with this?
>
> Thanks in advance!
>
> /Ylva
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: [OT] Re: [S2] Iterate through two lists

2008-08-28 Thread Jim Kiley
Have you bought any goats lately?

On Thu, Aug 28, 2008 at 1:12 PM, Al Sutton <[EMAIL PROTECTED]> wrote:

> Define "expesive"... Do you mean expensive?, if so expensive in what terms;
> memory, speed, required goat sacrifices?
>
> Al.
>
> Milan Milanovic wrote:
>
>> toArray() ? It works, but it is too expesive ?
>>
>> Milan
>>
>>
>>
>> newton.dave wrote:
>>
>>
>>> --- On Thu, 8/28/08, Al Sutton wrote:
>>>
>>>
>>>> C... I love a puzzle..
>>>>
>>>> Can you give us the 9 characters in an anagram??
>>>>
>>>>
>>> A rotary? (Plus two non-alpha, but it's already too easy now.)
>>>
>>> Not having enough information sure is a pain, huh.
>>>
>>> Dave
>>>
>>>
>>>
>>>> Dave Newton wrote:
>>>>
>>>>
>>>>> --- On Thu, 8/28/08, Milan Milanovic wrote:
>>>>>
>>>>>
>>>>>> "9-character JSP trick", what is this ?
>>>>>>
>>>>>>
>>>>> It's a clue that you could (potentially) solve [1]
>>>>>
>>>>>
>>>> your issue by adding 9 characters to your JSP, without
>>>> having to change anything in the Java code. The Set Javadocs
>>>> may help.
>>>>
>>>>
>>>>> Dave
>>>>>
>>>>> [1] ObCaveat: it's untested with your particular
>>>>>
>>>>>
>>>> data and implementation.
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>> -
>>>>
>>>>
>>>>> To unsubscribe, e-mail:
>>>>>
>>>>>
>>>> [EMAIL PROTECTED]
>>>>
>>>>
>>>>> For additional commands, e-mail:
>>>>>
>>>>>
>>>> [EMAIL PROTECTED]
>>>>
>>>>
>>>>>
>>>>>
>>>> --
>>>> Al Sutton
>>>>
>>>> W: www.alsutton.com
>>>> B: alsutton.wordpress.com
>>>> T: twitter.com/alsutton
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail:
>>>> [EMAIL PROTECTED]
>>>>
>>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Al Sutton
>
> W: www.alsutton.com
> B: alsutton.wordpress.com
> T: twitter.com/alsutton
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Using iterator tag to retrieve list from session

2008-08-26 Thread Jim Kiley
This doesn't directly address your question, but it seems to me that it
isn't a great idea to name your action method getList().  The default
assumption a reader will make is that getList() is a method intended to
return the value of a field called "list".  It is not clear to me how this
would interact with Struts.  Anyway -- I'd rename that method to execute()
or something, if I were you.

Anyway, as to your actual question, you appear to be iterating over the
"round" field of the "eventList" object, which doesn't have a "round" field
at all.  I suspect that you just want to iterate over eventList itself (or
#session.eventList, I forget offhand).

jk

On Tue, Aug 26, 2008 at 1:30 PM, Chriss Nold <[EMAIL PROTECTED]> wrote:

> Hello All,
> I am trying to retreive a list from the session and display that list
> on a jsp, but I am not entirely sure of the correct syntax for reading the
> list.  Any help would be appreciated.  Here is the code that I am cuurently
> using:
> Action class:
> package round;
>
> import java.sql.Connection;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.sql.Statement;
> import java.util.ArrayList;
> import java.util.List;
> import java.util.Map;
>
> import com.opensymphony.xwork2.ActionContext;
> import example.ExampleSupport;
> public class GetListAction extends ExampleSupport{
>public String getList() throws SQLException {
>Round round = new Round();
>List eventList = new ArrayList();
>Map session = (Map)ActionContext.getContext().get("session");
>String userName = String.valueOf(session.get("userName"));
>try {
>Statement stmt;
>Class.forName("com.mysql.jdbc.Driver");
>String url =
>"jdbc:mysql://localhost:3306/Nexus";
>String sql = "Select * " +
>"FROM round WHERE userName='" + userName + "'";
>Connection con =
>DriverManager.getConnection(
>url,"root", "*");
>stmt = con.createStatement();
>ResultSet rs = stmt.executeQuery(sql);
>  while(rs.next()){
>  round.setMatchID(rs.getInt(1));
>  round.setEventID(rs.getInt(2));
>  round.setUserName(rs.getString(3));
>  round.setRound(rs.getInt(4));
>  round.setPersona(rs.getString(5));
>  round.setResult(rs.getInt(6));
>  round.setOpponent(rs.getString(7));
>  eventList.add(round);
>}
>con.close();
>}catch( Exception e ) {
>e.printStackTrace();
>}
>session.put("eventList", eventList);
> System.err.println("Session objects: " + session.get("eventList"));
>return SUCCESS;
>}
> }
>
> Query is successful, and System.err.println displays: Session objects:
> [EMAIL PROTECTED]
>
> JSP:
> <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
>  http://www.w3.org/TR/html4/strict.dtd";>
> 
> 
> Welcome to Nexus!!!
> 
> 
>
> 
>
> 
> 
> 
>
> 
>
> 
> 
> 
>
>
>
>Welcome to the Nexus,  value="#session.userInfo.firstName"/>
>
>
>
>
>
>
> 
> Match ID
> Event ID
> Persona Used
>     Opponent
> Result
> Round
> 
> 
> 
>  
>
>  
> 
> 
> 
> 
> 
> 
>
>
> 
> 
> 
> 
> 
> 
>
>  
> 
>
>  
>
>
> 
> 
> 
> 
>
> Displays users first name, but not the list.
>
> Struts2 mapping:
>
> method="getList">
> name="success">/jsp/tournament/tournamentList.jsp
>
>
>
> Thanks in advance for the help,
> Chriss
>



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


Re: (Struts 2) Problem with uploading of file or validation

2008-08-12 Thread Jim Kiley
The javadoc for java.io.File mentions a constructor that accepts a URI as
its parameter.  It has the following note:

uri - An absolute, hierarchical URI with a scheme equal to "file", a
non-empty path component, and undefined authority, query, and fragment
components

So:
* Does the URI's path have any spaces in it?
* Is the URI's path empty?

jk

On Tue, Aug 12, 2008 at 12:41 PM, Ylva Degerfeldt <[EMAIL PROTECTED]
> wrote:

> Hi,
>
> I'm trying to upload a file (and some text values) from a
> multipart/form-data form. I'm also trying to use the validation
> framework (I have created a -validation.xml file) but when the action
> is receiving the values I get this exception:
>
> Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
>at java.io.File.(File.java:363)
>at
> com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)...
>
> I'm not sure if this is a validation error or a file uploading error.
> But I can tell you this:
> My action that is called by the multipart form (NameAndCvAction) has
> get and set methods for some text values from the form, for the file
> (like ...setCvFile(File cvFile)  ) and for the filename. I've tried
> stepping through these methods and I found that the file is received
> in the setCvFile method, like a File object, the way it should..
> The filename is correctly instantiated too..
> After that I receive the value of a text field, called firstName (not
> empty) which works..
> Then I receive the last value, lastName (which in my test case is
> empty) and that seems to work.
> But then my HibernateSessionRequestFilter (meant to close the
> Hibernate session for every request) is called and does the closing of
> the Hibernate session.
> After that I get the error.
>
> I also have a validate() method in my action but I don't seem to get that
> far.
>
> This is not a Hibernate issue or is it?
>
> Is there anyone who can give me a hint at what this error is about?
> I'd be very grateful!
>
> /Ylva
>
> ---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: [S2] Validating Forms with Wildcard Mapping

2008-08-05 Thread Jim Kiley
I can't see any reference anywhere that suggests that putting a wildcard in
the form's action attribute will work.  Even if it does work with client
side validation turned off, I get the impression -- and I could be wrong --
that you've stumbled into a weird corner case that just happens to work.  If
you would like to have more consistency in your application's behavior, I
think that Gabriel's advice is the way to go.  Have each submit send
"Subscription_execute" or "Subscription_cancel", and rely on the wildcarding
in struts.xml to route the request appropriately.

jk

On Tue, Aug 5, 2008 at 7:00 AM, Markus Stauffer
<[EMAIL PROTECTED]>wrote:

> I have this in my form:
>
> 
>  
>
>  
>  
> 
>
> It works like a charm. But if i turn on client side validation there
> are warnings/errors.
>
>
>
>
>
> On 8/5/08, Gabriel Belingueres <[EMAIL PROTECTED]> wrote:
> > AFAIK, wildcard mapping has sense only inside struts.xml.
> > In your form, you must specify exactly which action will be called,
> > like "Subscribe_dosomething"
> >
> > 2008/8/5 Markus Stauffer <[EMAIL PROTECTED]>:
> >> Hello all
> >>
> >> Say I have a struts2 form:
> >>
> >> 
> >>  
> >> 
> >>
> >>
> >> The javascript validation generated for this form is unfortunately
> >> invalid. Firefox complains about the "*" character.
> >>
> >> Is there any way to get around this without turning to server side
> >> validation?
> >>
> >> kind regards
> >> --
> >> Markus Stauffer
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Markus Stauffer
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: dojo anchor: get widget id and targets attributes inside subscribed topic?

2008-07-30 Thread Jim Kiley
What did the dojo mailing list [1] [2] recommend?

jk
[1] [EMAIL PROTECTED]
[2] http://dojotoolkit.org/*
*
On Wed, Jul 30, 2008 at 8:57 AM, holod <[EMAIL PROTECTED]> wrote:

>
> I use dojo anchor widget ().
> It successfully gets response in json from server, but I have several
> problems accessing widget, that published a topic.
> Please, see my code:
> dojo.event.topic.subscribe("/after", function(data, request, widget){
>alert('inside a topic event. after request');
>//data : text returned from request(the html)
>//request: XMLHttpRequest object
>//widget: widget that published the topic
> });
>
> Problems:
> 1. Can't change data value. If I use inside dojo.event.topic.subscribe:
> data = "this my new data!";
> alert("This is my new response from server: " + data);
>
> alert shows, that data value was changed,
> but targets of dojo anchor get previous value (why???).
> 2.I can't get widget properties: id of widget or targets. That's terrible,
> I
> need them very much. I've dumped the object widget, but there are no fields
> like id or targets.
> --
> View this message in context:
> http://www.nabble.com/dojo-anchor%3A-get-widget-id-and-targets-attributes-inside-subscribed-topic--tp18732617p18732617.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


  1   2   >