Re: Internalization problem: two internalizations for the same key

2008-05-07 Thread Toni Lyytikäinen
Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the
same situation. Are you using the i18n interceptor?  Also, how did you name
your resource files?


On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa <[EMAIL PROTECTED]>
wrote:

> Hi everyone,
>
> I have the following lines in my jsp file:
> label="%{getText('workingTeam.team')}" name="teamId" listKey="id"
> listValue="name"
>list="workingTeams" />
>
> 
>
> Of these two, using text tag gives me the internalization that has been
> selected as internationalization for the application. Using getText for
> select label gives me internalization in Finnish, no matter what is the
> selected internationalization. All internationalizations are in their own
> global ApplicationResources files. getText method is the standard method
> from ActionSupport.
>
> Any idea what is the cause of this, and what might be the solution?
>


Re: Disabling Browser AutoComplete in Struts tags

2008-04-22 Thread Toni Lyytikäinen
You could probably create your own theme and/or template for the tag where
you set the attribute in the template. But why not just use standard xhtml
tags for this - I mean just type it like this in the page:

< input type="text" name="userid" autocomplete="off" ... />

(extra space there to not make the email client try to interpret that as
xhtml)

On Wed, Apr 23, 2008 at 7:41 AM, Chris Pratt <[EMAIL PROTECTED]>
wrote:

> Is it possible to supply the autocomplete="off" parameter using the
> , , or  tags?
>
> Whether or not this is truly effective, my management wants our userid
> and password fields to supply this parameter to bring piece, harmony
> and security to the world wide web.  Is this possible using the Stuts
> Tags?
>  (*Chris*)
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
Yes it shouldn't be affected, but there seems to be a bug that affects this
behaviour, see WW-2599.

https://issues.apache.org/struts/browse/WW-2599


On Mon, Apr 21, 2008 at 2:20 PM, Adam Hardy <
[EMAIL PROTECTED]> wrote:

> Yes, I get the picture. If you haven't already, download the source bundle
> and look at the examples.
>
> Actually I don't think I understood one thing you said. You're using an
> action taglib in the JSP, which invokes the list retrieval. Surely that's
> not affected by validation failure? I was under the impression that the tag
> simply calls the default or specified method on the action.
>
>
> Toni Lyytikäinen on 21/04/08 12:00, wrote:
>
> > Well, for the retrieval I use stateless session bean injected to the
> > action
> > with Spring, like this (simplified):
> >
> > public User getUser() { return user; }
> >
> > public String edit() {
> >  user=dao.get(id);
> >  return SUCCESS;
> > }
> >
> > So it's nothing special.
> >
> > The session approach of course isn't ideal, but more a workaround until
> > the
> > bug gets solved or I find a better way to do it. The idea is that the
> > action
> > is still executed every time the user enters the form from a success
> > result,
> > and the non-fresh session based list is only used when validation fails.
> > I
> > don't know if you get the idea from this explanation.
> >
> > Other than that, I found out that the Preparable interface can also be
> > used
> > for this, so I might explore that option further.
> >
> > On Mon, Apr 21, 2008 at 1:19 PM, Adam Hardy <
> > [EMAIL PROTECTED]> wrote:
> >
> >  I think so - the chain is just a forward inside the same request so you
> > > shouldn't lose the field errors. But I'm just setting up a new website
> > > now
> > > with this approach, so actually I'm as inexperienced as you are - my
> > > previous Struts2 project had a different approach entirely.
> > >
> > > You second question regarding retrieval from the DB revolves around
> > > how
> > > you do the retrieval, but you don't say.
> > >
> > > I actually cheat like crazy and have a special domain object type
> > > converter which retrieves an Entity from the DB when the HTTP param =
> > > "entity=253" but this isn't the way type converters were meant to be
> > > used.
> > >
> > > This doesn't happen if validation fails, because I ordered the
> > > validation
> > > interceptor before the params interceptor in my interceptor stack. And
> > > of
> > > course the edit action doesn't do validation - just the save. (of
> > > course it
> > > throws an exception if you forget to send the id of the entity you
> > > want to
> > > edit).
> > >
> > > Generally this makes it easier to deal with nested entities.
> > >
> > > But if you just have a simple domain model, go the documented way. I
> > > shouldn't really be saying all this because I haven't got it working
> > > yet :(
> > >
> > > Re: lists, you can put them into the request but then you have to
> > > manage
> > > them in case some other user changes them. Plus you will use up
> > > memory. If
> > > you're using a decent persistence layer that has 'second level cache'
> > > which
> > > you can set up when you go live, rely on that instead for caching.
> > >
> > >
> > >
> > >
> > > Toni Lyytikäinen on 21/04/08 11:02, wrote:
> > >
> > >  Thanks for the answer! Does the resultType="chain" approach preserve
> > > > the
> > > > fieldErrors and the values the user has already typed into the form?
> > > > Also,
> > > > how do you prevent the edit action from retrieving the entity from
> > > > the
> > > > database in the case the validation fails?
> > > >
> > > > I also thought about putting the lists into the http session instead
> > > > of
> > > > the
> > > > request, but I don't really like cluttering the session with such
> > > > things.
> > > >
> > > >
> > > > On Mon, Apr 21, 2008 at 12:55 PM, Adam Hardy <
> > > > [EMAIL PROTECTED]> wrote:
> > > >
> > > >  Hi Toni
> > > >
> > > > > there are several different approa

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
Well, for the retrieval I use stateless session bean injected to the action
with Spring, like this (simplified):

public User getUser() { return user; }

public String edit() {
  user=dao.get(id);
  return SUCCESS;
}

So it's nothing special.

The session approach of course isn't ideal, but more a workaround until the
bug gets solved or I find a better way to do it. The idea is that the action
is still executed every time the user enters the form from a success result,
and the non-fresh session based list is only used when validation fails. I
don't know if you get the idea from this explanation.

Other than that, I found out that the Preparable interface can also be used
for this, so I might explore that option further.

On Mon, Apr 21, 2008 at 1:19 PM, Adam Hardy <
[EMAIL PROTECTED]> wrote:

> I think so - the chain is just a forward inside the same request so you
> shouldn't lose the field errors. But I'm just setting up a new website now
> with this approach, so actually I'm as inexperienced as you are - my
> previous Struts2 project had a different approach entirely.
>
> You second question regarding retrieval from the DB revolves around how
> you do the retrieval, but you don't say.
>
> I actually cheat like crazy and have a special domain object type
> converter which retrieves an Entity from the DB when the HTTP param =
> "entity=253" but this isn't the way type converters were meant to be used.
>
> This doesn't happen if validation fails, because I ordered the validation
> interceptor before the params interceptor in my interceptor stack. And of
> course the edit action doesn't do validation - just the save. (of course it
> throws an exception if you forget to send the id of the entity you want to
> edit).
>
> Generally this makes it easier to deal with nested entities.
>
> But if you just have a simple domain model, go the documented way. I
> shouldn't really be saying all this because I haven't got it working yet :(
>
> Re: lists, you can put them into the request but then you have to manage
> them in case some other user changes them. Plus you will use up memory. If
> you're using a decent persistence layer that has 'second level cache' which
> you can set up when you go live, rely on that instead for caching.
>
>
>
>
> Toni Lyytikäinen on 21/04/08 11:02, wrote:
>
> > Thanks for the answer! Does the resultType="chain" approach preserve the
> > fieldErrors and the values the user has already typed into the form?
> > Also,
> > how do you prevent the edit action from retrieving the entity from the
> > database in the case the validation fails?
> >
> > I also thought about putting the lists into the http session instead of
> > the
> > request, but I don't really like cluttering the session with such
> > things.
> >
> >
> > On Mon, Apr 21, 2008 at 12:55 PM, Adam Hardy <
> > [EMAIL PROTECTED]> wrote:
> >
> >  Hi Toni
> > >
> > > there are several different approaches. The one I use has an Edit
> > > action
> > > and a Save action. The Edit action fetches the dropdown list and puts
> > > it in
> > > the request and results in the form jsp.
> > >
> > > The form submits to Save and if validation fails, the Input result is
> > > resultType="chain" and pipes the request back to the Edit action.
> > >
> > > HTH
> > > Adam
> > >
> > >
> > > Toni Lyytikäinen on 21/04/08 10:05, wrote:
> > >
> > >  Hello,
> > > >
> > > > What is generally regarded as the best practise for populating a
> > > > select
> > > > element in a form from database so that it works regardless of the
> > > > action
> > > > and the result from which the form is displayed?
> > > >
> > > > I've tried this:
> > > >
> > > > action configuration:
> > > > 
> > > >  /WEB-INF/jsp/admin/userForm.jsp
> > > > 
> > > > 
> > > >  
> > > >   list
> > > >  
> > > >  /WEB-INF/jsp/admin/userForm.jsp
> > > > 
> > > >
> > > >
> > > > jsp page:
> > > > 
> > > > 
> > > > 
> > > > ...
> > > > 
> > > >
> > > > where listIntoRequest looks like this:
> > > >
> > > > public String listIntoRequest() {
> > > >  List list=dao.getListFromDatabase();
> > > >  request.setAttribute("list", list);
> > > >  return SUCCESS;
> > > > }
> > > >
> > > > but the problem is with validation. If the validation fails, and the
> > > > input
> > > > result is returned in the in the form processing page (save), then
> > > > the
> > > > action tag never executes the method listIntoRequest (see WW-2599),
> > > > and
> > > > the
> > > > form will not display correctly.
> > > >
> > > >
> > > > -
> > > 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]
>
>


Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
Thanks for the answer! Does the resultType="chain" approach preserve the
fieldErrors and the values the user has already typed into the form? Also,
how do you prevent the edit action from retrieving the entity from the
database in the case the validation fails?

I also thought about putting the lists into the http session instead of the
request, but I don't really like cluttering the session with such things.


On Mon, Apr 21, 2008 at 12:55 PM, Adam Hardy <
[EMAIL PROTECTED]> wrote:

> Hi Toni
>
> there are several different approaches. The one I use has an Edit action
> and a Save action. The Edit action fetches the dropdown list and puts it in
> the request and results in the form jsp.
>
> The form submits to Save and if validation fails, the Input result is
> resultType="chain" and pipes the request back to the Edit action.
>
> HTH
> Adam
>
>
> Toni Lyytikäinen on 21/04/08 10:05, wrote:
>
> > Hello,
> >
> > What is generally regarded as the best practise for populating a select
> > element in a form from database so that it works regardless of the
> > action
> > and the result from which the form is displayed?
> >
> > I've tried this:
> >
> > action configuration:
> > 
> >  /WEB-INF/jsp/admin/userForm.jsp
> > 
> > 
> >  
> >list
> >  
> >  /WEB-INF/jsp/admin/userForm.jsp
> > 
> >
> >
> > jsp page:
> > 
> > 
> > 
> > ...
> > 
> >
> > where listIntoRequest looks like this:
> >
> > public String listIntoRequest() {
> >   List list=dao.getListFromDatabase();
> >   request.setAttribute("list", list);
> >   return SUCCESS;
> > }
> >
> > but the problem is with validation. If the validation fails, and the
> > input
> > result is returned in the in the form processing page (save), then the
> > action tag never executes the method listIntoRequest (see WW-2599), and
> > the
> > form will not display correctly.
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
Hello,

What is generally regarded as the best practise for populating a select
element in a form from database so that it works regardless of the action
and the result from which the form is displayed?

I've tried this:

action configuration:

  /WEB-INF/jsp/admin/userForm.jsp


  
list
  
  /WEB-INF/jsp/admin/userForm.jsp



jsp page:



...


where listIntoRequest looks like this:

public String listIntoRequest() {
   List list=dao.getListFromDatabase();
   request.setAttribute("list", list);
   return SUCCESS;
}

but the problem is with validation. If the validation fails, and the input
result is returned in the in the form processing page (save), then the
action tag never executes the method listIntoRequest (see WW-2599), and the
form will not display correctly.


Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-21 Thread Toni Lyytikäinen
I'm using 2.1.1-SNAPSHOT from the people.apache.org maven snapshot
repository. I noticed 2.1.2-SNAPSHOT is already out, maybe I should try it.

I have scope="prototype" in the actions that I've defined in the Spring
configuration file. The problem also affects actions that are not in the
Spring configuration file, in other words actions that are not in need of
any injections from Spring.

I might take a look at XWork's SpringObjectFactory code to see what is going
under the hood, if I have time.


On Fri, Apr 18, 2008 at 11:24 PM, Brad A Cupit <[EMAIL PROTECTED]> wrote:

> >> I'm wondering if this is related to the CGLIB issue.
>
> Hrm...he's using the redirectAction which has been immune to the CGLIB
> issue (assuming we're talking about the same issue). The 'chain' result
> is prone to the CGLIB problem. Having said that, I haven't used Struts
> 2.1.x at all.
>
> The exception being thrown is known to be ok. The parameters will first
> try to be set as properties on the Result class, then the ones which are
> not reserved as special properties will be set in the url by
> ServletActionRedirectResult.
>
> This is/was a known issue for 2.0.x and 2.1.0 as well. Sometime during
> 2.1.1 development, WW-2170 [1] was fixed, which should stop this issue.
>
> Toni, are you using the latest version of Struts 2.1 from trunk?
>
> [1] https://issues.apache.org/struts/browse/WW-2170
>
> Brad Cupit
> Louisiana State University - UIS
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
Well, as I already posted in the issue, it turned out that this is somehow
caused by the Spring plugin. If I disable the Spring plugin, it works fine
(apart from the fact that my DAOs won't get injected to the actions, of
course).


Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
Well, I found out that the problem is not the ognl expression, as trying to
set static parameters won't work.

I already filed a bug, WW-2600

My action config is quite large, I wonder which are the relevant parts...?

Here's the interceptor stack:



















add,input,back,cancel


add,input,back,cancel


user



Here's the part with the actionmapping:

 

Users_list


Users_edit
true
${user.username}

/WEB-INF/jsp/CustomerAdmin/Users_userForm.jsp


The error message and the full stacktrace is in the bug report here:

https://issues.apache.org/struts/browse/WW-2600

I'm using Struts 2.1.1-SNAPSHOT and XWork 2.1.1



On Fri, Apr 18, 2008 at 5:05 PM, Al Sutton <[EMAIL PROTECTED]> wrote:

> Toni,
>
> Can you post your updated action config and the full stack trace here,
> there may be something simple we can spot before needing to log a bug.
>
> Al.
>
> ----- Original Message - From: "Toni Lyytikäinen" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Friday, April 18, 2008 2:28 PM
> Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
> convert parameters to actions
>
>
> Yes I forgot to mention in the original post that I already changed the
> "redirect-action" to "redirectAction" as per the migration guide here:
>
>
> http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html
>
>
>
>
>


Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
Yes I forgot to mention in the original post that I already changed the
"redirect-action" to "redirectAction" as per the migration guide here:

http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html




On Fri, Apr 18, 2008 at 4:26 PM, Dave Newton <[EMAIL PROTECTED]> wrote:

> I'm confused; I didn't think "redirect-action" would even work; that
> result
> type isn't mapped in 2.1 and you should get an exception stating exactly
> that.
>
> Dave
>
> --- Jukka Välimaa <[EMAIL PROTECTED]> wrote:
>
> > For Struts 2.1.1, use type="redirectAction" instead of
> > type="redirect-action". I just had the pleasure of debugging some
> problems
> > caused by it.
> > On Fri, Apr 18, 2008 at 4:12 PM, Don Brown <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hmm...what should happen is those exceptions should be logged as a
> > > warn, but the process should continue like normal.  If that isn't the
> > > case, definitely file a bug and put it against 2.1.2
> > >
> > > Don
> > >
> > > On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <[EMAIL PROTECTED]>
> > > wrote:
> > > > Hello,
> > > >
> > > >  I'm in the process of converting a Struts 2.0.11 application to
> Struts
> > > >  2.1.1, and ran into some trouble concerning the action result
> > > configuration
> > > >  in struts.xml. Basically this is what I had in 2.0.11:
> > > >
> > > >  
> > > >   Users_edit
> > > >   true
> > > >   ${user.username}
> > > >  
> > > >
> > > >  This resulted in an url like http://.../Users_edit.action?name=toni
> > > >
> > > >  But for 2.1.1 this approach isn't working, as it throws an
> exception:
> > > >
> > > >  There was an exception while instantiating the result of type
> > > >  org.apache.struts2.dispatcher.ServletActionRedirectResult
> > > >  Caught OgnlException while setting property 'name' on type
> > > >  'org.apache.struts2.dispatcher.ServletActionRedirectResult'. -
> Class:
> > > >  ognl.ObjectPropertyAccessor
> > > >  ...
> > > >  Caused by: ognl.NoSuchPropertyException:
> > > >  org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> > > >
> > > >  What do I need to do to make these kind of  definitions compatible
> > with
> > > >  Struts 2.1.1?
> > > >
> > >
> > > -
> > > 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]
>
>


Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
Yep, already did that as per the migration guide, but the problem could to
be the ognl expression which doesn't seem to work in 2.1.1. I'll have to
look into it further.

And yes, the exception actually causes an HTTP status 500 with


Caught OgnlException while setting property 'name' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - action
- file:/usr/local/glassfish-v2ur1/domains/domain1/applications/j2ee-modules/...


so I'll be filing a bug soon.


On Fri, Apr 18, 2008 at 4:18 PM, Al Sutton <[EMAIL PROTECTED]> wrote:

> Toni,
>
> Try using redirectAction instead of redirect-action.
>
> Al.
>
> - Original Message - From: "Don Brown" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Friday, April 18, 2008 2:12 PM
> Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
> convert parameters to actions
>
>
>
> Hmm...what should happen is those exceptions should be logged as a
> warn, but the process should continue like normal.  If that isn't the
> case, definitely file a bug and put it against 2.1.2
>
> Don
>
> On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <[EMAIL PROTECTED]>
> wrote:
>
> > Hello,
> >
> >  I'm in the process of converting a Struts 2.0.11 application to Struts
> >  2.1.1, and ran into some trouble concerning the action result
> > configuration
> >  in struts.xml. Basically this is what I had in 2.0.11:
> >
> >  
> >  Users_edit
> >  true
> >  ${user.username}
> >  
> >
> >  This resulted in an url like http://.../Users_edit.action?name=toni
> >
> >  But for 2.1.1 this approach isn't working, as it throws an exception:
> >
> >  There was an exception while instantiating the result of type
> >  org.apache.struts2.dispatcher.ServletActionRedirectResult
> >  Caught OgnlException while setting property 'name' on type
> >  'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> >  ognl.ObjectPropertyAccessor
> >  ...
> >  Caused by: ognl.NoSuchPropertyException:
> >  org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> >
> >  What do I need to do to make these kind of  definitions compatible with
> >  Struts 2.1.1?
> >
> >
> -
> 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]
>
>


Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
Hello,

I'm in the process of converting a Struts 2.0.11 application to Struts
2.1.1, and ran into some trouble concerning the action result configuration
in struts.xml. Basically this is what I had in 2.0.11:


  Users_edit
  true
  ${user.username}


This resulted in an url like http://.../Users_edit.action?name=toni

But for 2.1.1 this approach isn't working, as it throws an exception:

There was an exception while instantiating the result of type
org.apache.struts2.dispatcher.ServletActionRedirectResult
Caught OgnlException while setting property 'name' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
ognl.ObjectPropertyAccessor
...
Caused by: ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.name

What do I need to do to make these kind of  definitions compatible with
Struts 2.1.1?


Re: persistence and doubts on usage of hibernate in struts 2

2008-02-29 Thread Toni Lyytikäinen
Hard to say where the problem lies without having a look at the DAO code.
Are you using OpenSessionInViewFilter or similar mechanism for lazy loading
in the view? If yes, try setting the param singleSession to false like this:

OSIVFilter

org.springframework.orm.hibernate3.support.OpenSessionInViewFilter


singleSession
false


Also, you can define the field to be unique in the Hibernate mapping. That
way the object can only be persisted to database if the email field is
unique. Otherwise it will throw a ConstraintViolationException that you can
catch. But the recommended approach is to first try to fix the problems in
the DAO layer.


On Fri, Feb 29, 2008 at 2:23 PM, Vinicius Cubas Brand <
[EMAIL PROTECTED]> wrote:

> Hello. I am having a problem with the usage of hibernate and its
> persistence
> mechanism.
>
> I have an Action with a method for creation of an entity type and other
> method for updating. This action implements a Preparable and in its method
> prepare() I verify if the entity is being created or updated, depending if
> an ID came from the jsp form.
>
>
> public void prepare() throws Exception {
> if (getId() == null) {
> operador = new Operador();
> } else {
> operador = getSegurancaService().carregarOperador(id);
> }
> }
>
> (This Operador is a model with a corresponding table on the database.)
>
> Before saving, I have a condition to verify. I need to verify if there is
> another row in the table Operador in the database with the same value in
> the
> field Operador.email, for instance. In my previous systems working with
> another languages, I did the following in this case:
>
> - fetch object from database
> - update its properties with the form values
> - made the necessary validations, and IF the validations pass, save the
> object (for instance calling a method Object.save). I am doing manual
> validations in the action.
>
> However, for hibernate this does not work, because it considers the
> updated
> object as part of the database. So when I  try to fetch in the database to
> see if there is already a row with Operador.email field with the value
> entered in the form, the Hibernate automatically saves the current
> operador
> before fetching and will ever find a row (the current) with the desired
> value for e-mail field.
>
>
> Is there some way to disable this auto-saving behaviour in Hibernate?
>
> I thought about ever creating a new object to receive the form data, after
> that make the validations I need to, and after the validations pass, get
> the
> object I want to update from the database and do a kind of merge between
> the
> new object with the form data and the object from the database;
>
> What do you do in these situations? What do you recommend? thanks.
>
>
>
>
> Vinicius Cubas Brand
> DATAPROM(R)
> Software para Clientes
> www.dataprom.com
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to get method name in interceptor

2008-02-21 Thread Toni Lyytikäinen
I'm trying to write an interceptor that makes redirecting decisions based on
an annotation on the method on that is going to be executed. Like this:


public class MyAction extends ActionSupport {
...
   @SomeAnnotation(value="value")
   public String list() {
   ...
   return SUCCESS;
   }
}

public class MyInterceptor extends AbstractInterceptor {
...
   public String intercept(ActionInvocation invocation) throws Exception {
   // check if there is an annotation on the method that is going to be
executed
   // redirect based on that:
  if (something) invocation.invoke()
  else return "someresult";
   }
}

For this reason it would be nice to get the method, or at least the name of
the method, so that the interceptor could do method.getAnnotation(
SomeAnnotation.class).

On Thu, Feb 21, 2008 at 2:59 PM, <[EMAIL PROTECTED]> wrote:

> Tell me more.  One thing I have learned using Struts 2 is if you think it
> should be possible, it probably is!  What are you trying?
>
> On Thu, Feb 21, 2008 at 1:29 AM, Toni Lyytikäinen <[EMAIL PROTECTED]>
> wrote:
>
> > Thanks. This approach works, but isn't quite as elegant as I was hoping.
> >
> > On Wed, Feb 20, 2008 at 2:47 PM, <[EMAIL PROTECTED]> wrote:
> >
> > > download the breadcrumb
> > > <http://strutsschool.com/downloads/downloads.action>interceptor
> > > and look at the intercept method.  You will see what's happening right
> > > away.
> > >
> > >
> > >
> > > On Wed, Feb 20, 2008 at 5:40 AM, Toni Lyytikäinen <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm trying to access the ActionMapping from an interceptor, like the
> > > > following test stub:
> > > >
> > > > public String intercept(ActionInvocation invocation) throws
> Exception
> > {
> > > >ActionMapping am=ServletActionContext.getActionMapping();
> > > >log.info("The method is "+am.getMethod());
> > > >return invocation.invoke();
> > > >}
> > > >
> > > > According to the javadocs am.getMethod() should return a String (the
> > > > method), but for some reason am.getMethod() always returns null. The
> > > > am.getName() and am.getNamespace() methods seem to work correctly
> > > however.
> > > > Is there a way (that works) to extract the name of the method that
> is
> > > > going
> > > > to be executed?
> > > >
> > >
> > >
> > >
> > > --
> > > Scott
> > > [EMAIL PROTECTED]
> > >
> >
>
>
>
> --
> Scott
> [EMAIL PROTECTED]
>


Re: How to get method name in interceptor

2008-02-20 Thread Toni Lyytikäinen
Thanks. This approach works, but isn't quite as elegant as I was hoping.

On Wed, Feb 20, 2008 at 2:47 PM, <[EMAIL PROTECTED]> wrote:

> download the breadcrumb
> <http://strutsschool.com/downloads/downloads.action>interceptor
> and look at the intercept method.  You will see what's happening right
> away.
>
>
>
> On Wed, Feb 20, 2008 at 5:40 AM, Toni Lyytikäinen <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > I'm trying to access the ActionMapping from an interceptor, like the
> > following test stub:
> >
> > public String intercept(ActionInvocation invocation) throws Exception {
> >ActionMapping am=ServletActionContext.getActionMapping();
> >log.info("The method is "+am.getMethod());
> >return invocation.invoke();
> >}
> >
> > According to the javadocs am.getMethod() should return a String (the
> > method), but for some reason am.getMethod() always returns null. The
> > am.getName() and am.getNamespace() methods seem to work correctly
> however.
> > Is there a way (that works) to extract the name of the method that is
> > going
> > to be executed?
> >
>
>
>
> --
> Scott
> [EMAIL PROTECTED]
>


How to get method name in interceptor

2008-02-20 Thread Toni Lyytikäinen
Hi,

I'm trying to access the ActionMapping from an interceptor, like the
following test stub:

public String intercept(ActionInvocation invocation) throws Exception {
ActionMapping am=ServletActionContext.getActionMapping();
log.info("The method is "+am.getMethod());
return invocation.invoke();
}

According to the javadocs am.getMethod() should return a String (the
method), but for some reason am.getMethod() always returns null. The
am.getName() and am.getNamespace() methods seem to work correctly however.
Is there a way (that works) to extract the name of the method that is going
to be executed?


Trouble configuring spring plugin

2008-02-08 Thread Toni Lyytikäinen
Hi,
I recently started converting an older project to Struts 2.0.11 and maven.
The project uses spring plugin for injecting certain dependencies into the
actions. The problem is, that I would like to use the constructor
autowiring, as described in the configuration file (struts.properties):

### specifies the autoWiring logic when using the SpringObjectFactory.
### valid values are: name, type, auto, and constructor (name is the default)
struts.objectFactory.spring.autoWire = constructor

However, this results in an exception when instantiating the Struts actions:

javax.servlet.ServletException: Unable to instantiate Action,
net.x.y.web.Login,  defined for 'Login' in namespace '/'Just constants
AUTOWIRE_BY_NAME and AUTOWIRE_BY_TYPE allowed - action -
file:/**/WEB-INF/classes/struts-base.xml:20:68


If I change the autoWire setting to type, I get an

javax.servlet.ServletException: Unable to intantiate Action!

type exception, because the action has constructor arguments that really
need to be injected there somehow.

Am I missing some dependency, or have the spring folks dropped support for
the auto and constructor settings while I was away?


Re: Displaytag problems

2007-09-04 Thread Toni Lyytikäinen
Yes, there are several approaches to it, using AjaxTags, Ajax Anywhere, YUI,
Prototype etc. It might be possible to implement it in Dojo too, I don't
know enough about Dojo to say anything certain. All solutions are somewhat
hackish though, and I wouldn't really recommend using them. AjaxTags is the
easiest (it has a tag for it), but it's sort of heavyweight library that
adds a lot of extra dependecies to the web project. With YUI and Prototype
you'll have to manually code some Javascript, but it's not too hard. The
basic idea is presented here:

http://raibledesigns.com/rd/entry/the_future_of_the_displaytag

You don't really need Ajax Anywhere for this though, and the Prototype part
is somewhat easily converted into some other Ajax library, like YUI's
Connection Manager.

BTW. what's the status of Ajax support in Table Tags? It would be nice to
have a clean solution to implementing Ajax-based paging and sorting with a
powerful table library.

On 9/4/07, Didier Coignet <[EMAIL PROTECTED]> wrote:
>
> Yeah, if I leave the requestURI field empty it calls the action which
> loads
> the list from a webservice/database. But I already have so data, so I
> don't
> need to load the data again. This is why I created an empty action.
>
> After some copying from other struts actions and some republishing and
> restarting the tomcat it is now working - but I don't know why :-)
>
> Btw.: Has anyone managed to do sorting and paginating calls from
> displaytag
> by ajax/dojo? I have no glue how to get it into displaytag :-)
>
> Best Regards,
> Marc
>
> 2007/9/4, Didier Coignet <[EMAIL PROTECTED]>:
> >
> > Have you tried to put leave the requestURI field in displaytag empty ?
> >
> >  > sort="list" requestURI="" cellspacing="0"
> > cellpadding="0">
> >
> > in my case i had pagination problems and that solved it (still dont know
> > why).
> > Regards didier.
> >
> >
> >
>


Re: tabltags

2007-08-27 Thread Toni Lyytikäinen
http://displaytag.sourceforge.net/11/export_filter.html

On 8/27/07, Manuel Correa <[EMAIL PROTECTED]> wrote:
>
> Sorry is display tags:
>
>
>
> http://displaytag.sourceforge.net/11/
>
>
>
>
>
>
>
> Manuel Correa.
>
> Application Analyst Specialist.
>
> ITOS, Carl Vinson Institute of Government.
>
> The University of Georgia.
>
> Tel. (706) - 542-2164
>
>
>
>


Re: Save Action Invocation

2007-08-23 Thread Toni Lyytikäinen
It's quite possible. Take a look at the comments here:
http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor

On 8/23/07, Phillip Grenier <[EMAIL PROTECTED]> wrote:
>
> I don't know if this is possible or not but I would like to have a
> authentication interceptor that if a user is not authenticated it saves
> the action being called in session and then continues to a login action.
> Then after the user has successfully logged in it would call the stored
> action again this time passing the interceptor.
>


Re: Sanitize Text

2007-08-23 Thread Toni Lyytikäinen
You could just override the string conversion in xwork:

http://struts.apache.org/2.x/docs/type-conversion.html

define something like this in xwork-conversion.properties

java.lang.String=org.example.MyConverter

Then create a class MyConverter that extends the XWorkBasicConverter and
override the behaviour of the convertValue method in the case of string to
string conversion.

I'm not sure if this is actually a good way, but it's easy enough and with
simple configuration it works everywhere in you webapp.

On 8/23/07, Ian Roughley <[EMAIL PROTECTED]> wrote:
>
> This is a good approach.  In fact, you might start with the params
> interceptor - as it is responsible for assigning data to the action, and
> all that is needed is to sanitize before assignment.
>
> /Ian
>
> Richard Sayre wrote:
> > I was wondering what the best approach would be for taking form data
> > passed to an Action and removing 'special characters' from the data.
> > I am having issues with users pasting text from word docs etc.  We
> > only support ISO-8859-1 as of now and there are some characters that
> > Word will replace such as ' and " with character that are outside the
> > 8839-1 character set.
> >
> > I was thinking about an interceptor that would sanitize the request
> > parameters before they are passed to the action.  Is this a good
> > approach?  Can anyone suggest a better one?  It does not matter if it
> > uses Struts or not.
> >
> > Thank you
> >
> > -
> > 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]
>
>


Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
Lazy initialization is to boost performance. The problem is that it doesn't
apply to all cases. In cases where you have to iterate over a list of
objects and those have lazy loading properties that you need, it will
generate a lot of extra queries to to database. In those cases it's best to
use eager loading to fetch the properties. However, if you eager load too
many properties, the queries will become slow because of the joins. So it's
all about finding a good balance that fits you database schema. In order to
find the balance monitor the amount of queries your actions make, and the
time it took to execute the queries. In some simple database schemas OSIV
can be avoided but with complex schemas this isn't always the case.

On 8/22/07, hezjing <[EMAIL PROTECTED]> wrote:
>
> This is something new to me, I always thought that lazy initialization
> is to boost performance. So we should really use eager fetching by
> default and minimize the use of OSIV.
>
>
> On 8/22/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
> > "And, is there a better alternative than using
> > OpenSessionInViewInterceptor?"
> >
> > Yes. It's important to realise that while OpenSessionInView feels very
> > handy, it is not a particularly nice design pattern, as it can stress
> your
> > database with lots of small queries. It's best to learn how to do eager
> > fetching with Hibernate and use it for most cases and rely on OSIV only
> in
> > some special cases where eager fetching is not possible. This way it's
> often
> > possible to build entire web applications without resorting to use OSIV.
> >
>
>
> --
>
> Hez
>


Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
"And, is there a better alternative than using
OpenSessionInViewInterceptor?"

Yes. It's important to realise that while OpenSessionInView feels very
handy, it is not a particularly nice design pattern, as it can stress your
database with lots of small queries. It's best to learn how to do eager
fetching with Hibernate and use it for most cases and rely on OSIV only in
some special cases where eager fetching is not possible. This way it's often
possible to build entire web applications without resorting to use OSIV.


Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
You can't use the OpenSessionInViewInterceptor from Spring in Struts 2.
Struts 2 interceptors are not compatible with Spring interceptors as they
have their own interface. You'll have to use OpenSessionInViewFilter. Take a
look here:

http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/OpenSessionInViewFilter.html



On 8/22/07, hezjing <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I'm encountering this exception (when trying to iterate a list of
> orders for a specific customer in JSP),
>
> failed to lazily initialize a collection of role:
> com.dummy.Customer.orders, no session or session was closed
> at
> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException
> (AbstractPersistentCollection.java:358)
> at
> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected
> (AbstractPersistentCollection.java:350)
> at org.hibernate.collection.AbstractPersistentCollection.initialize(
> AbstractPersistentCollection.java:343)
> at org.hibernate.collection.AbstractPersistentCollection.read(
> AbstractPersistentCollection.java:86)
> at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:249)
> at org.apache.struts2.util.MakeIterator.convert(MakeIterator.java:81)
> ..
>
> I'm using Struts 2, Hibernate and Spring (for creating actions, DAOs and
> etc).
>
> I read that Spring's OpenSessionInViewInterceptor will resolve this
> problem but can you describe how to configure
> OpenSessionInViewInterceptor in Struts2?
>
> And, is there a better alternative than using
> OpenSessionInViewInterceptor?
>
>
>
> --
>
> Hez
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Having problem with Swedish characters in request

2007-08-21 Thread Toni Lyytikäinen
I don't remember having any similar problems with the Finnish locale which
is nearly the same as the Swedish one. The cause of the problem is probably
that the parameters are in wrong encoding (UTF-8 most probably). Since you
are using ISO-8859-1, check that the browser in the form page is actually
using that encoding (in Firefox View->Character Encoding or right click on
page ->View Page Info). Also check the encoding settings of you Application
Server or Servlet Container. Adding the default locale and encoding scheme
into struts.properties also may or may not help:

### This can be used to set your default locale and encoding scheme
struts.locale=fi_FI
struts.i18n.encoding=iso-8859-15

(subsitute fi_FI for your locale)

On 8/21/07, Md. Ariful Islam <[EMAIL PROTECTED]> wrote:
>
>
> Hello all,
>
> is there anyone who can give me some light on this problem?  I need this
> very urgently.  Hope you'll be kind enough to response quickly.
>
> ~ Arif
>
> "Md. Ariful Islam" <[EMAIL PROTECTED]> wrote: Hello all,
>
> I am using struts 2 to develop a web-application.  I'm having problem when
> I submit a form having any Swedish character (like ö, å or ä) in a textbox,
> it becomes '?' in the action class.  In the beginning of the jsp file, I
> have the code below:
>
>
>
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
>
>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
>
> " rel="stylesheet" type="text/css"/>
>
> "  type="text/javascript"/>
>
>
> ...
>
>
>
>
> I haven't added any language configuration related stuffs anywhere
> else.  One more thing,  it has no problem with characters in the
> response.  I mean, when i have one of those characters in a string in the
> database and want to show it on the page, it works fine.
>
> Can anyone please help me?
>
> Thanks,
> ~ Arif
>
>
>
> -
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.
>
>
> -
> Ready for the edge of your seat? Check out tonight's top picks on Yahoo!
> TV.


Re: capturing the value of a tag in an action

2007-08-14 Thread Toni Lyytikäinen
I don't know if you can capture the checkbox value to String, boolean should
work though (it works for me at least). Try changing the String element to
boolean.

On 8/14/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I started a thread on this topic a while back, but the example I was
> guided to was hard to understand and implement.
>
> The question is straight forward: How do you get the value of a checkbox
> from within an action?
>
> - I have named my  in the jsp, and have a private String
> element with the same name in my action
> - I have created get/set methods
>
> Each time I try to obtain the value when a button is pressed, I get null,
> regardless of whether the checkbox is clicked or not.
>
> It's easy and straight forward to get the value of other tags (textfield,
> selectbox, ...), so I'm thinking that there's something more for
> checkboxes.  Do I need to set an interceptor?  Please let me know whether
> I'm missing something here.
>
> Thanks,
> Session
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: struts 2.0.8 problem implementing filter

2007-08-10 Thread Toni Lyytikäinen
Sorry, but why go the hard way when you can achieve the same with a simple
interceptor? You can return a global result from a interceptor (f.ex. return
"errorPage") which is lot simpler than getting tangled with the
RequestDispatcher stuff.

On 8/10/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
>
> Sorry, but why go the hard way when you can achieve the same with a simple
> interceptor? You can return a global result from a filter (f.ex. return
> "errorPage") which is lot simpler than getting tangled with the
> RequestDispatcher stuff.
>
> On 8/10/07, Eugen Stoianovici <[EMAIL PROTECTED]> wrote:
> >
> > i'm trying to use a custom filter to implement authorization and i can't
> > get the damned thing to work (i'm an absolute beginner, be warned).
> > i'm using struts2.0.8 with tomcat 5.5
> >
> > my doFilter method looks like this
> > public class AuthorizationFilter implements Filter {
> > public void doFilter(ServletRequest request, ServletResponse response,
> >FilterChain chain) throws IOException, ServletException {
> >
> >HttpServletRequest req = (HttpServletRequest) request;
> >HttpServletResponse res = (HttpServletResponse) response;
> >
> >HttpSession session = req.getSession();
> >Employee employee = (Employee) session.getAttribute("user");
> >boolean hasRole = false;
> >  if(employee!=null){
> >for (int i = 0; i < roleNames.length; i++) {
> >if (employee.hasRole(roleNames[i])) {
> >hasRole = true;
> >break;
> >}
> >}
> >}
> >if (hasRole) {
> >chain.doFilter(request, response);
> >} else {
> >req.getRequestDispatcher(onErrorUrl).forward(req, res);
> >}
> > }
> > }
> >
> > the browser reports: (line 47 is
> > req.getRequestDispatcher(onErrorUrl).forward(req, res); )
> >
> > *type* Exception report
> >
> > *message*
> >
> > *description* _The server encountered an internal error () that
> > prevented it from fulfilling this request._
> >
> > *exception*
> >
> > org.apache.jasper.JasperException
> > org.apache.jasper.servlet.JspServletWrapper.handleJspException(
> > JspServletWrapper.java:476)
> >
> > org.apache.jasper.servlet.JspServletWrapper.service (
> > JspServletWrapper.java:389)
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> > :315)
> >
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> > javax.servlet.http.HttpServlet.service (HttpServlet.java:803)
> > security.AuthorizationFilter.doFilter(AuthorizationFilter.java:47)
> >
> > *root cause*
> >
> > java.lang.NullPointerException
> > org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java :58)
> > org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(
> > StrutsBodyTagSupport.java:52)
> >
> > org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(
> > ComponentTagSupport.java:49)
> >
> > org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0(index_jsp.java:102)
> > org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > org.apache.jasper.servlet.JspServletWrapper.service(
> > JspServletWrapper.java:328)
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> > :315)
> >
> > org.apache.jasper.servlet.JspServlet.service (JspServlet.java:265)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > security.AuthorizationFilter.doFilter(AuthorizationFilter.java:47)
> >
> > *
> > *__
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


Re: struts 2.0.8 problem implementing filter

2007-08-10 Thread Toni Lyytikäinen
Sorry, but why go the hard way when you can achieve the same with a simple
interceptor? You can return a global result from a filter (f.ex. return
"errorPage") which is lot simpler than getting tangled with the
RequestDispatcher stuff.

On 8/10/07, Eugen Stoianovici <[EMAIL PROTECTED]> wrote:
>
> i'm trying to use a custom filter to implement authorization and i can't
> get the damned thing to work (i'm an absolute beginner, be warned).
> i'm using struts2.0.8 with tomcat 5.5
>
> my doFilter method looks like this
> public class AuthorizationFilter implements Filter {
> public void doFilter(ServletRequest request, ServletResponse response,
>FilterChain chain) throws IOException, ServletException {
>
>HttpServletRequest req = (HttpServletRequest) request;
>HttpServletResponse res = (HttpServletResponse) response;
>
>HttpSession session = req.getSession();
>Employee employee = (Employee) session.getAttribute("user");
>boolean hasRole = false;
>  if(employee!=null){
>for (int i = 0; i < roleNames.length; i++) {
>if (employee.hasRole(roleNames[i])) {
>hasRole = true;
>break;
>}
>}
>}
>if (hasRole) {
>chain.doFilter(request, response);
>} else {
>req.getRequestDispatcher(onErrorUrl).forward(req, res);
>}
> }
> }
>
> the browser reports: (line 47 is
> req.getRequestDispatcher(onErrorUrl).forward(req, res); )
>
> *type* Exception report
>
> *message*
>
> *description* _The server encountered an internal error () that
> prevented it from fulfilling this request._
>
> *exception*
>
> org.apache.jasper.JasperException
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(
> JspServletWrapper.java:476)
>
> org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:389)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> :315)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> security.AuthorizationFilter.doFilter(AuthorizationFilter.java:47)
>
> *root cause*
>
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(
> StrutsBodyTagSupport.java:52)
>
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(
> ComponentTagSupport.java:49)
>
> org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0
> (index_jsp.java:102)
> org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:328)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> :315)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> security.AuthorizationFilter.doFilter(AuthorizationFilter.java:47)
>
> *
> *__
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to list a property in a display:table (Struts 2)

2007-08-08 Thread Toni Lyytikäinen
Set the uid attribute in the display:table -tag like this:



On 8/8/07, fergunet <[EMAIL PROTECTED]> wrote:
>
>
> Hi all!
>
> I've created a display table to show a list of things and their
> attributes.
> But one of those attributes is another list of objects. I don't know how
> to
> print their names.
>
> Let's see what I have:
>
>
>  defaultsort="1"
>defaultorder="ascending" export="true" id="row"
> requestURI="/user/list.mpch" >
> 
>  sortable="true" headerClass="sortable"/>
>  sortable="true" headerClass="sortable"/>
>  sortable="true" headerClass="sortable"/>
>  sortable="true" headerClass="sortable"/>
>  sortable="true" headerClass="sortable"/>
>  sortable="true" headerClass="sortable"/>
>
> 
> 
> ITERATE
> 
>
>
> 
>  headerClass="sortable">
> 
> Is provider
> 
> 
> Is not provider
> 
> 
>
>
> Look at the "roles" property column. That property is a List which
> have an attribute RoleBaseVO wich have the String "name". I'm trying to
> show
> the list of that names. (Now only prints:
> [EMAIL PROTECTED],
> [EMAIL PROTECTED],
> [EMAIL PROTECTED] )
>
> I thought to use an iterator as you can see, but the "ITERATE!!!" string
> is
> never shown.
>
> Any ideas? Thanks in advance, and sorry about my English.
> --
> View this message in context:
> http://www.nabble.com/How-to-list-a-property-in-a-display%3Atable-%28Struts-2%29-tf4236011.html#a12052184
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Localizing the list in a -tag?

2007-08-08 Thread Toni Lyytikäinen
Hello,

Is it possible to localize the options in the list attribute of the
-tag? I've tried several approaches but none of them seem to work.
What I'm aiming at is something like the following:



For some reason it seems to be impossible to use double quotes (") for the
elements in the map, unless escaped, and the escaping means that the
expression inside won't be evaluated.


Re: Struts 2 Validation multiple validators on same field

2007-08-07 Thread Toni Lyytikäinen
That validation config doesn't seem to make much sense to me. The field
accountNumber cannot be both int and string, so you have to use required
instead of requiredstring if you want to process the input as int. If you
want it as string, you have to use something else than the int validator,
possibly regex or fieldexpression validator. Also the validators for the
field should be inside the same < field > -tag so they can be
short-circuited. Try something like this (almost straight copy/paste from
the struts wiki pages):


  
  You must enter a value for accountNumber.
  
  
  6
  10
  bar must be between ${min} and ${max}, current
value is ${accountNumber}.
  



On 8/8/07, orshoe <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
> I am trying to enforce a "requiredstring" on a text field and also make
> sure
> it follows certain constraints. I am using the following in the
> -validation.xml:
>
> ---
> 
> 
> 
>   6
>   10
> Account Number cannot be less than ${min} or greater
> than ${max}. Its currently ${accountNumber}
> 
> 
> 
> 
> You must enter Account Number
> 
> 
> 
>
> ---
> The problem is, I am getting both the messages displayed (also the "You
> must
> enter Account Number") even when there is a value (say, 5) entered in the
> field. Is there any way to get only the appropriate message displayed
> based
> on the input.
> note: Please ignore the extra spaces in the param tags, I had
> intentionally
> added the space to make sure the message preview'd properly.
> --
> View this message in context:
> http://www.nabble.com/Struts-2-Validation-multiple-validators-on-same-field-tf4232748.html#a12042474
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Gettin the selected item in a s:tree

2007-08-06 Thread Toni Lyytikäinen
YUI has great documentation, there are also nice examples at:

http://developer.yahoo.com/yui/treeview/


On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>
> Do you have an example, because I know nothing about YUI.
>
> Also, I saw in the link you provided that there is a workaround for dojo,
> but I can't even check it out because I downloaded dojo and followed the
> HelloWorld tutorial, but it doesn't work.  I don't know what files/jars to
> include in my project for the dojo code to work.
>
> Could you send me an example of the workaround you used?
>
> Thanks,
> Session
>
>
> > I'm under the impression that the selected topic publishing isn't
> > currently working in Struts 2. At least the examples in the showcase app
> > aren't working for me (in Firefox 2.0.0.6). When I had to do something
> > similar I found this:
> >
> http://issues.apache.org/struts/browse/WW-1813?page=com.atlassian.jira.pl
> > ugin.system.issuetabpanels:all-tabpanel
> >
> > It says that it's fixed in 2.1.0, but since that isn't released yet, I
> > just decided to implement the tree using YUI and writing all the
> > javascript parts manually (it isn't very hard anyway).
> >
> > On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi again,
> >>
> >> Anyone has a clue about obtaining a user's selection in an s:tree
> >> element?  I used the example from the showcase, and I don't fully
> >> understand the following script:
> >>
> >>  function treeNodeSelected(nodeId) { dojo.io.bind({ url:
> " >> value='dynamicTreeSelectAction.action' />?nodeId="+nodeId, load:
> >> function(type, data, evt) { var displayDiv = dojo.byId("displayId");
> >> displayDiv.innerHTML = data; }, mimeType: "text/html" }); };
> >>
> >> dojo.event.topic.subscribe("treeSelected", this, "treeNodeSelected");
> >> 
> >>
> >> I put in logging inside every method of my dynamicTreeSelectAction
> >> action, but nothing gets logged, so I gather that the node selection is
> >> not properly handled.  Can someone explain to me what is going on in
> >> this script and why my action is never being called.
> >>
> >> If you need to see the s:tree declaration, here it is:  >> valign="top">   >> rootNode="%{treeRootNode}" childCollectionProperty="childrenNodes"
> >> nodeIdProperty="id" nodeTitleProperty="name"
> >> treeSelectedTopic="treeSelected">  
> >>
> >>  
> >>
> >> There used to be some instruction text between the  >> id="displayId"> tag, but I removed it.  There's a reference to
> >> this div in the script above, but I don't know how it's being used.
> >>
> >> Any help would be truly appreciated.
> >>
> >> Best, Session
> >>
> >>
> >>> Hi,
> >>>
> >>> I was able to get the selected item from a s:select element, which
> >>> can
> >> be
> >>> accessed from the property variable that is associated with it.  Now
> >>> I'm trying to do the same with the s:tree element.  But it seems as
> >>> though there is no property object association with s:tree.  How would
> >>> I go about getting a user's tree node selection from code?
> >>>
> >>> Thanks, Session
> >>>
> >>>
> >>> -
> >>> 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]
>
>


Re: populating input fields on page load

2007-08-06 Thread Toni Lyytikäinen
I believe the correct spelling is redirect-action

http://cwiki.apache.org/WW/action-configuration.html

On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>
> I get the following:
> Caused by: There is no result type defined for type 'redirectAction'
> mapped with name 'createSMIG' - result - file:/C:/jboss-
> 4.2.1.GA/server/default/deploy/zen.server.war/WEB-INF/classes/edu/cmu/sei/smart/zen/server/smigmaintenance/smigmaintenance-config.xml:21:52
>
> I'm using struts 2.0.6, is redirectAction not defined for it?
>
> > --- Session A Mwamufiya wrote:
> >> I tried to follow this approach, but my server fails in struts.xml,
> >> stating that there's an error in building results for my first action.
> >
> > Does it say anything in particular about the error?
> >
> > d.
> >
> >
> >
> >
> _
> > ___ Luggage? GPS? Comic books? Check out fitting gifts for grads
> at
> > Yahoo! Search
> > http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
> >
> > - 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]
>
>


Re: populating input fields on page load

2007-08-06 Thread Toni Lyytikäinen
Does your class implement Preparable interface? Do you have the interceptor
in your interceptor stack? Also, check the syntax of the preparable method -
it should be void like this

public class TestAction extends SomeClass implements Preparable {
...
public void prepare() {
log.debug("This should be called");
}

...
}

http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html

On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>
> Hi, could you give me an actual example, because I added a method called
> Prepare() in my class, but it never gets called.  Here's my code:
>
> public String Prepare() {
>   log.debug("Populating form fields if a SMIG was selected");
>
>   // ...
>
>   return SUCCESS;
> }
>
> Nothing gets logged when the form is displayed.  Is there something else
> that needs to be setup in the jsp?
>
> Thanks,
> Session
>
>
> > Hi,
> >
> > Implement the prepare method in your action class and add the code in
> that
> > method.
> >
> > Thanks,
> >
> > Nuwan
> >
> >
> > Session A Mwamufiya wrote:
> >> Hi,
> >>
> >> I have a page with input fields, and would like my action to populate
> >> those fields before they get displayed.  This page is handled by a
> >> certain action, but it is the result page from a different action (I
> >> click on a button in the previous action form, and this one gets called
> >> up).  I put some logging in my code, and see that the execute() method
> >> never gets called before the page is displayed.
> >>
> >> This is what my form looks like:  >> target="SMIGEditor">  >> label="%{getText('smigVersion')}" />  >> label="%{getText('smigDesc')}" />  >> method="saveButtonPressed" /> 
> >>
> >> Any ideas?
> >>
> >> Thanks, Session
> >>
> >>
> >> -
> 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]
>
>


Re: Gettin the selected item in a s:tree

2007-08-06 Thread Toni Lyytikäinen
I'm under the impression that the selected topic publishing isn't currently
working in Struts 2. At least the examples in the showcase app aren't
working for me (in Firefox 2.0.0.6). When I had to do something similar I
found this:
http://issues.apache.org/struts/browse/WW-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

It says that it's fixed in 2.1.0, but since that isn't released yet, I just
decided to implement the tree using YUI and writing all the javascript parts
manually (it isn't very hard anyway).

On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>
> Hi again,
>
> Anyone has a clue about obtaining a user's selection in an s:tree
> element?  I used the example from the showcase, and I don't fully understand
> the following script:
>
> 
> function treeNodeSelected(nodeId) {
> dojo.io.bind({
> url: " />?nodeId="+nodeId,
> load: function(type, data, evt) {
> var displayDiv = dojo.byId("displayId");
> displayDiv.innerHTML = data;
> },
> mimeType: "text/html"
> });
> };
>
> dojo.event.topic.subscribe("treeSelected", this, "treeNodeSelected");
> 
>
> I put in logging inside every method of my dynamicTreeSelectAction action,
> but nothing gets logged, so I gather that the node selection is not properly
> handled.  Can someone explain to me what is going on in this script and why
> my action is never being called.
>
> If you need to see the s:tree declaration, here it is:
> 
>   
>theme="ajax"
>   rootNode="%{treeRootNode}"
>   childCollectionProperty="childrenNodes"
>   nodeIdProperty="id"
>   nodeTitleProperty="name"
>   treeSelectedTopic="treeSelected">
> 
>   
>
>   
> 
>
> There used to be some instruction text between the  id="displayId"> tag, but I removed it.  There's a reference to this
> div in the script above, but I don't know how it's being used.
>
> Any help would be truly appreciated.
>
> Best,
> Session
>
>
> > Hi,
> >
> > I was able to get the selected item from a s:select element, which can
> be
> > accessed from the property variable that is associated with it.  Now I'm
> > trying to do the same with the s:tree element.  But it seems as though
> > there is no property object association with s:tree.  How would I go
> > about getting a user's tree node selection from code?
> >
> > Thanks, Session
> >
> >
> > - 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]
>
>


Re: HTML Encoding in Struts2

2007-08-01 Thread Toni Lyytikäinen
http://struts.apache.org/2.x/docs/property.html

The property tag escapes the string by default. Try 

On 8/1/07, Sawan <[EMAIL PROTECTED]> wrote:
>
>
> Hi experts,
>
> I have following code...
>
> JAVA:
> ArrayList obj = new ArrayList();
> obj.add(" www.google.com Visit google ");
> obj.add(" www.yahoo.com Visit yahoo ")
>
> JSP:
> 
> 
> 
>
> On jsp page source, I am getting " href="www.google.com">Visit google" and
> "Visit yahoo"
>
> So it is not linking "Visit google" and "Visit yahoo", instead of it is
> showing the whole string " www.google.com Visit google " and
> www.yahoo.com
> Visit yahoo .
>
> How can I make both linkable..?
>
> Thanks in advance
>
> Sawan
>
>
> --
> View this message in context:
> http://www.nabble.com/HTML-Encoding-in-Struts2-tf4198863.html#a11942087
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Contacting struts 2 documentation writers

2007-07-31 Thread Toni Lyytikäinen
Those examples don't actually work the way they should, do they? The tree
renders fine, but the topics are not working correctly. The text on the side
prompts to click a node, but clicking the node does nothing. Looks like the
event handler never gets called.

On 7/31/07, Ted Husted <[EMAIL PROTECTED]> wrote:
>
> On 7/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > then there are examples:
> >
> > http://struts.apache.org/download.cgi#struts209
>
> And within the examples, there are static and dynamic tree examples in
> the Showcase:
>
> * http://www.planetstruts.org/struts2-showcase/tags/ui/
>
> -Ted.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts 2 performance

2007-07-15 Thread Toni Lyytikäinen

I tried this too, and I can confirm that it does actually shut down the
server. The return value of the method that the property tag references is
evaluated for some reason, which makes the application vulnerable to OGNL
injection attacks... this is a huge security problem.

On 7/16/07, Aram Mkhitaryan <[EMAIL PROTECTED]> wrote:


Maybe it's new just for me, but I found out one of the main reasons of the
problem

try to submit "[EMAIL PROTECTED]@exit(0)}" in the viewable property
for example you submit a text, and it is displayed by s2's tags

try and have fun ...

this expression works and my server shuts down!

the problem I mentioned is that when I say "print property" it executes it
at first ...
but it should not! I'm right, amn't I?

why it executes the string value in my property?
(it's not just a problem, it's a security risk, the users can hack s2
sites)
(at least who may read this message will know that he can hack s2 sites
and
the simplest way is given above)

that's why even when you do not use ognl expressions, it still works and
it
costs ...

Best,
Aram

Aram Mkhitaryan

52, 25 Lvovyan, Yerevan 375000, Armenia

Mobile: +374 91 518456
E-mail: [EMAIL PROTECTED]



Re: ParameterAware Not Working

2007-07-14 Thread Toni Lyytikäinen

It's not a String but an array of Strings. [ in front of the object
indicates an array.

On 7/14/07, Richard Sayre <[EMAIL PROTECTED]> wrote:


I am implemnting ParameterAware to get my request parameters:

http://cwiki.apache.org/WW/how-can-we-access-request-parameters-passed-into-an-action.html

I have a parameter called customerId.

I tried this

Integer.parseInt(parameters.get("customerId"));

Which did not work because .get returns an Object.

Calling toString on the object returns the type and memory address so
I decided to cast it to a String:

Integer.parseInt((String)parameters.get("customerId"));

Now I get a runtime error on that line of code that says:

[Ljava.lang.String; cannot be cast to java.lang.String

I checked the type of object int he Map and it is a String.  But it
seems impossible to access the value in that object since toString
does not return the value and casting it to a String does not work
because it is already a String.  Am I missing something obvious here?
I can't think of a way to get the value of customerId.

Thank you,

Rich

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] autocompleter, predefining initial value

2007-07-13 Thread Toni Lyytikäinen

No, so far I have been programming with the YUI api directly using
Javascript, as I need all kinds of widgets, not just the autocompleter and
calendar. I may take a look at the YUI plugin and possibly try to add new
widgets to it, if I manage to find the time.

On 7/13/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:



I agree , autocompleter is too slow...
Are you using  the
http://cwiki.apache.org/confluence/display/S2PLUGINS/YUI+Plugin  ?

Herrera





Toni Lyytikäinen wrote:
>
> I used a JSON action which outputs an array of arrays like this:
>
> [
> ["VALUE", "KEY"],
> ["VALUE2", "KEY2"],
> ...
> ]
>
> I build the list beforehand in the Action with an iterator over a
> List.
> I don't know about ftl since I've never used it. And now I'm in the
> process
> of migrating the app to use YUI, since dojo includes seem to slow down
the
> app too much, and YUI has nicer selection of widgets and easier api...
>
> On 7/13/07, Pedro Herrera < [EMAIL PROTECTED]> wrote:
>>
>>
>> Hi Toni.
>>How do you assemble your list ? In my case I´m using a jsp result
that
>> is
>> made from AjaxUtil . Is it possible to use flt for this case ?. In the
>> showcase example, uses a option.flt(value only), but I need two, key
and
>> value instead.
>>
>> Thanks
>>
>> Herrera
>>
>>
>>
>> Toni Lyytikäinen wrote:
>> >
>> > Whoops, sorry I should probably think before I post. So you want to
set
>> > the
>> > key, not the value of the input element. I did this by having a
>> > getElementKey-method in the Action class which returns the key you
want
>> as
>> > the default. Element is the name of the input element.
>> >
>> > On 7/12/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
>> >>
>> >> The value attribute sets the preset value of the input element, if
>> that
>>
>> >> is
>> >> what youre looking for.
>> >> 
>> >>
>> >> On 7/12/07, Pedro Herrera <[EMAIL PROTECTED] > wrote:
>> >> >
>> >> >
>> >> > I´m using autocompleter tag with Struts 2.0.8 and I need to show a
>> >> > default
>> >> > value to the user.
>> >> >
>> >> > For example, in the JSON list :
>> >> >
>> >> > [
>> >> > ["Alabama","AL"],
>> >> > ["Alaska","AK"],
>> >> > ["American Samoa","AS"],
>> >> > ...
>> >> >
>> >> > I need to show by default 'AS(id) - American Samoa' . How I do
this
>> ?
>> >> >
>> >> >
>> >> > Herrera
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>>
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982
>>
>> >> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >> >
>> -
>>
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11576447
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11577695
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] autocompleter, predefining initial value

2007-07-13 Thread Toni Lyytikäinen

I used a JSON action which outputs an array of arrays like this:

[
["VALUE", "KEY"],
["VALUE2", "KEY2"],
...
]

I build the list beforehand in the Action with an iterator over a
List.
I don't know about ftl since I've never used it. And now I'm in the process
of migrating the app to use YUI, since dojo includes seem to slow down the
app too much, and YUI has nicer selection of widgets and easier api...

On 7/13/07, Pedro Herrera < [EMAIL PROTECTED]> wrote:



Hi Toni.
   How do you assemble your list ? In my case I´m using a jsp result that
is
made from AjaxUtil . Is it possible to use flt for this case ?. In the
showcase example, uses a option.flt(value only), but I need two, key and
value instead.

Thanks

Herrera



Toni Lyytikäinen wrote:
>
> Whoops, sorry I should probably think before I post. So you want to set
> the
> key, not the value of the input element. I did this by having a
> getElementKey-method in the Action class which returns the key you want
as
> the default. Element is the name of the input element.
>
> On 7/12/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
>>
>> The value attribute sets the preset value of the input element, if that

>> is
>> what youre looking for.
>> 
>>
>> On 7/12/07, Pedro Herrera <[EMAIL PROTECTED] > wrote:
>> >
>> >
>> > I´m using autocompleter tag with Struts 2.0.8 and I need to show a
>> > default
>> > value to the user.
>> >
>> > For example, in the JSON list :
>> >
>> > [
>> > ["Alabama","AL"],
>> > ["Alaska","AK"],
>> > ["American Samoa","AS"],
>> > ...
>> >
>> > I need to show by default 'AS(id) - American Samoa' . How I do this ?
>> >
>> >
>> > Herrera
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> 
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982

>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > -

>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11576447
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen

Take a look at the html generated by the tag, is there an initialKey
-attribute and what is it's value? If it is "29" then it's working for the
key part at least.

Of course I forgot to say that you need to set both the initial value and
the initial key. You can set the value with the value attribute. It's not
very nice solution but it works. 



On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:



It´s not working to me 



I´ve setted the in the action countryIdKey = "29" and the combo comes
blank...

help me

Herrera




Toni Lyytikäinen wrote:
>
> Whoops, sorry I should probably think before I post. So you want to set
> the
> key, not the value of the input element. I did this by having a
> getElementKey-method in the Action class which returns the key you want
as
> the default. Element is the name of the input element.
>
> On 7/12/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
>>
>> The value attribute sets the preset value of the input element, if that
>> is
>> what youre looking for.
>> 
>>
>> On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > I´m using autocompleter tag with Struts 2.0.8 and I need to show a
>> > default
>> > value to the user.
>> >
>> > For example, in the JSON list :
>> >
>> > [
>> > ["Alabama","AL"],
>> > ["Alaska","AK"],
>> > ["American Samoa","AS"],
>> > ...
>> >
>> > I need to show by default 'AS(id) - American Samoa' . How I do this ?
>> >
>> >
>> > Herrera
>> >
>> >
>> > --
>> > View this message in context:
>> >
>>
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982
>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11559311
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen

Whoops, sorry I should probably think before I post. So you want to set the
key, not the value of the input element. I did this by having a
getElementKey-method in the Action class which returns the key you want as
the default. Element is the name of the input element.

On 7/12/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:


The value attribute sets the preset value of the input element, if that is
what youre looking for.


On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:
>
>
> I´m using autocompleter tag with Struts 2.0.8 and I need to show a
> default
> value to the user.
>
> For example, in the JSON list :
>
> [
> ["Alabama","AL"],
> ["Alaska","AK"],
> ["American Samoa","AS"],
> ...
>
> I need to show by default 'AS(id) - American Samoa' . How I do this ?
>
>
> Herrera
>
>
> --
> View this message in context:
> 
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen

The value attribute sets the preset value of the input element, if that is
what youre looking for.


On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:



I´m using autocompleter tag with Struts 2.0.8 and I need to show a default
value to the user.

For example, in the JSON list :

[
["Alabama","AL"],
["Alaska","AK"],
["American Samoa","AS"],
...

I need to show by default 'AS(id) - American Samoa' . How I do this ?


Herrera


--
View this message in context:
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tab Persistance

2007-07-11 Thread Toni Lyytikäinen

I'm just redirecting to an address that's formed like this (see the result
type "redirect-action" in the docs):

http://myapp.com/here/is/the/url.action?active=myTab

Are you doing any redirecting between the the form post and the tabbed page,
or are you just posting to an action that renders the tabbed page? Because
redirects don't by default preserve parameters, you have to configure them
manually. If you're taking the second approach, and you have get/set-methods
for your active element, quickly thinking, you could possibly just use
selectedTab=""?

On 7/11/07, Brian Trzupek <[EMAIL PROTECTED]> wrote:


Toni,

So when you say you use "%{#parameters['active']}" after "setting a
parameter in the request", what are you actually doing?

As I have added a hidden field in my form that has an "active"
element that I set to the current tab, but it never comes back to the
page?

Any idea where I went wrong?

Thanks,
brian-


On Jul 10, 2007, at 8:50 AM, Toni Lyytikäinen wrote:

> I'd like to know the best practice too. I've done this setting a
> parameter
> in the request, and in my jsp I have
>
> 
>
> not very elegant but works.
>
> On 7/10/07, Brian Trzupek <[EMAIL PROTECTED]> wrote:
>>
>> I have a page with several Struts Tabs on it.
>>
>> When I submit the page, I would like it to come back to the 'active'
>> tab (the previous selected tab).
>>
>> Is there a best practice on how to do this?
>>
>> Thanks,
>> Brian-
>>
>> -
>> 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]




Re: Struts 2 performance

2007-07-11 Thread Toni Lyytikäinen

After playing around with Firebug a little I found out that in our project
the most costly thing in the page loading process is loading the dojo
.js-files. For some reason they are included in the xhtml theme too. If I
substitute



with



leaving out the dojo stuff, pages are loading really fast again. Is there
any reason besides the client side validation that the dojo includes are
needed for the xhtml theme?


Re: redirecting a non-secure request to one that uses https

2007-07-11 Thread Toni Lyytikäinen

Google is your friend,
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletResponse.html#sendRedirect(java.lang.String)

You can get the URL with a method in the HttpServletRequest class,
getRequestURL(), substitute "https" for "http" in there and redirect to that
page with response.sendRedirect(..). That will exclude any parameters,
however but, if needed, implementing that is left as an excercise...

In HTTP pages don't send data to pages, but rather browsers get responses
from servers by sending requests. The problem with this kind of interceptor
is, that if an interceptor catches a request that is not secure, then the
request (and all its parameters, more importantly) has already travelled
across the internet from the browser to the server unprotected. If that
request is redirected to an SSL-protected page, it will only make the
browser send the request again, protected this time, but as it already has
travelled across the lines with no protection, this approach is not actually
protecting the data in the request. Such a filter (or interceptor) should
only be used for testing that the page flow is working with SSL all the
time, not for any actual production use (or at least I can't imagine a
situation where it would fit).


On 7/10/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:


Hi Tony,

Thanks for the reply.  I use an interceptor to check the
HttpServletRequest's isSecure() method in order to determine it if is secure
or not.  I've never used the HttpServletResponse object and I'm not sure how
to redirect to the same address but with https.  The redirecting won't be to
only one page, but will depend on the request.  All of the pages in my web
app are controlled by actions, so there's no data being sent from one page
to another without the original page being intercepted to check for ssl
usage.  Please let me know how to use HttpServletResponse for redirecting.

Thanks,
Session


> It may be an ugly hack, but it has worked for some of my actions. If you
> return null instead of the action name to be invocated, you can use a
> response object to send information directly to the user. The
> HttpServletRequest object has method isSecure() which you can use to
> determine whether the request is secure or not. If it's not use the
> HttpServletResponse object to redirect the user to the secure location.
>
> The other approach is to make a plain simple filter to do this, since
you
>  probably won't need any of the Struts features for this kind of task.
>
> But this shouldn't be used for anything but simple front page redirects.

> If the user sends a non-SSL request then he has already sent all the
> information unprotected across the internet, and just redirecting him to
> an SSL-protected page doesn't really help in securing the application.
>
> On 7/10/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
>>
>> Hi All,
>>
>> I've installed SSL on my JBoss container (it works) and have created an

>>  interceptor that checks that the requests to my web app are secure
>> (using https).  I would like to redirect all non-secure requests to use
>> ssl and have https in the address.  How can this be done?  I'm not sure

>> how to tweak the request object or the action invocation to make this
>> happen.
>>
>> Thanks, Session
>>
>>
>> -
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]




Re: Tab Persistance

2007-07-10 Thread Toni Lyytikäinen

I'd like to know the best practice too. I've done this setting a parameter
in the request, and in my jsp I have



not very elegant but works.

On 7/10/07, Brian Trzupek <[EMAIL PROTECTED]> wrote:


I have a page with several Struts Tabs on it.

When I submit the page, I would like it to come back to the 'active'
tab (the previous selected tab).

Is there a best practice on how to do this?

Thanks,
Brian-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: redirecting a non-secure request to one that uses https

2007-07-10 Thread Toni Lyytikäinen

It may be an ugly hack, but it has worked for some of my actions. If you
return null instead of the action name to be invocated, you can use a
response object to send information directly to the user. The
HttpServletRequest object has method isSecure() which you can use to
determine whether the request is secure or not. If it's not use the
HttpServletResponse object to redirect the user to the secure location.

The other approach is to make a plain simple filter to do this, since you
probably won't need any of the Struts features for this kind of task.

But this shouldn't be used for anything but simple front page redirects. If
the user sends a non-SSL request then he has already sent all the
information unprotected across the internet, and just redirecting him to an
SSL-protected page doesn't really help in securing the application.

On 7/10/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:


Hi All,

I've installed SSL on my JBoss container (it works) and have created an
interceptor that checks that the requests to my web app are secure (using
https).  I would like to redirect all non-secure requests to use ssl and
have https in the address.  How can this be done?  I'm not sure how to tweak
the request object or the action invocation to make this happen.

Thanks,
Session


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen

I took a look at that, but it's not actually written for Struts but for
WebWork 2.x and the AroundInterceptor class it extends is not included in
Struts 2. I don't know what that page is doing in Struts documentation,
since it won't even compile with vanilla Struts 2.

On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:



Thank you a lot! Toni. That answer cleared my question.

Have you noticed there is Non-IoC version of OpenSessionInViewInterceptor
in
the Apache Struts 2 Documents. Please click the below link:


http://struts.apache.org/2.x/docs/non-ioc-version-of-opensessioninviewinterceptor.html

I don't know if this one work?



Toni Lyytikäinen wrote:
>
> Sorry, I must have read the post too quickly and assumed you were
talking
> about the filter, because I haven't really seen a working OSIV
interceptor
> for Struts 2. If you want to use an interceptor, you'll probably have to
> write one yourself for Struts 2. I don't think the one in Spring can be
> configured to work with the interceptor stack in Struts 2 because it's
so
> heavily tied to Spring interfaces and concepts.
>
> On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:
>>
>>
>> Thank you Toni for your example.
>> I'm just wondering about the OpenViewInSessionInterceptor. Don't know
how
>> to
>> configure it in struts2.
>>
>> Thanks again!
>>
>>
>>
>> Toni Lyytikäinen wrote:
>> >
>> > I can't really say about Spring 1.2.8 because I've only ever used 2.0
,
>> but
>> > here's what I did:
>> >
>> > in web.xml:
>> >
>> > 
>> > 
>> >   OSIVFilter
>> >   
>> > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>> > 
>> > 
>> > ...
>> > 
>> >   OSIVFilter
>> >   /*
>> > 
>> > 
>> >   struts2
>> >   /*
>> > 
>> > 
>> >   
org.springframework.web.context.ContextLoaderListener
>> > 
>> > 
>> > 
>> >   contextConfigLocation
>> >   /WEB-INF/applicationContext*.xml
>> > 
>> > ..
>> > 
>> >
>> > Of course you also need to have your (Hibernate) SessionFactory set
in
>> > Spring's applicationContext-file.
>> >
>> >
>> > On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> I'm new to Spring and Struts2 and currently working on an existing
>> >> project(Spring 1.2.8+ struts+hibernate 3) which is upgrading to
>> struts2.
>> >> Need to add OpenViewInSessionInterceptor to the project to enalbe
the
>> >> lazy
>> >> loaing in the presentation layor. I've searched the forum and didn't
>> get
>> >> the
>> >> answer.
>> >>
>> >> I would appreciate any inputs.
>> >>
>> >> --
>> >> View this message in context:
>> >>
>>
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11503872
>> >> Sent from the Struts - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
-
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11504395
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11505610
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen

Sorry, I must have read the post too quickly and assumed you were talking
about the filter, because I haven't really seen a working OSIV interceptor
for Struts 2. If you want to use an interceptor, you'll probably have to
write one yourself for Struts 2. I don't think the one in Spring can be
configured to work with the interceptor stack in Struts 2 because it's so
heavily tied to Spring interfaces and concepts.

On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:



Thank you Toni for your example.
I'm just wondering about the OpenViewInSessionInterceptor. Don't know how
to
configure it in struts2.

Thanks again!



Toni Lyytikäinen wrote:
>
> I can't really say about Spring 1.2.8 because I've only ever used 2.0,
but
> here's what I did:
>
> in web.xml:
>
> 
> 
>   OSIVFilter
>   
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
> 
> 
> ...
> 
>   OSIVFilter
>   /*
> 
> 
>   struts2
>   /*
> 
> 
>   org.springframework.web.context.ContextLoaderListener
> 
> 
> 
>   contextConfigLocation
>   /WEB-INF/applicationContext*.xml
> 
> ..
> 
>
> Of course you also need to have your (Hibernate) SessionFactory set in
> Spring's applicationContext-file.
>
>
> On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:
>>
>>
>> I'm new to Spring and Struts2 and currently working on an existing
>> project(Spring 1.2.8+ struts+hibernate 3) which is upgrading to
struts2.
>> Need to add OpenViewInSessionInterceptor to the project to enalbe the
>> lazy
>> loaing in the presentation layor. I've searched the forum and didn't
get
>> the
>> answer.
>>
>> I would appreciate any inputs.
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11503872
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11504395
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen

I can't really say about Spring 1.2.8 because I've only ever used 2.0, but
here's what I did:

in web.xml:



 OSIVFilter
 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter


...

 OSIVFilter
 /*


 struts2
 /*


 org.springframework.web.context.ContextLoaderListener



 contextConfigLocation
 /WEB-INF/applicationContext*.xml

..


Of course you also need to have your (Hibernate) SessionFactory set in
Spring's applicationContext-file.


On 7/9/07, panpan <[EMAIL PROTECTED]> wrote:



I'm new to Spring and Struts2 and currently working on an existing
project(Spring 1.2.8+ struts+hibernate 3) which is upgrading to struts2.
Need to add OpenViewInSessionInterceptor to the project to enalbe the lazy
loaing in the presentation layor. I've searched the forum and didn't get
the
answer.

I would appreciate any inputs.

--
View this message in context:
http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11503872
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




The -tag - how to use properly?

2007-07-02 Thread Toni Lyytikäinen

I'm trying to make a simple page like the one in the struts showcase app
that displays a tree, and when the user clicks a node, the page will display
information about that node. The problem is however, that the documentation
on the tree-tag is scarce and the example in the showcase app (version 2.0.8)
doesn't work. It seems the event processing isn't working. Here's what I'm
trying to work up from:


   dojo.event.topic.subscribe("treeSelected", function
treeNodeSelected(node)) {
   alert("It works!");
   });




I've also tried the approach in the showcase app, but it doesn't work
either. So how can I subscribe to the events sent by the tree constructed
with the tree-tag?


How to pass messages that survive redirects?

2007-06-29 Thread Toni Lyytikäinen

I've used to doing something like this in Ruby on Rails:

if @object.updateAttributes(params[:object])
   flash[:notice]="Update succesful!"
   redirect_to :action=>'list'
else ...

Now that I'm using Struts 2 for a project I tried doing something similar:

try {
   objectService.save(getObject());
   addActionMessage("Update succesful!");
   return "redirect";
} catch (...)


But I found out that the actionmessages don't show in the redirected action
anymore (probably because then it's another instance of that class that
doesn't have the same actionmessages property), even though I have the
-tag. Is there a mechanism to pass messages from actions
that survive a redirect? Or should I just put them into the users session?


Re: Struts 2 Login example using a session

2007-06-27 Thread Toni Lyytikäinen

Or better yet, create a Login interceptor or Login filter that checks the
session and redirects to login page if the required key is not there. Make
package(s) of the actions you want to expose to authenticated users only and
put the interceptor into that packages interceptor stack.

On 6/27/07, Wesley Wannemacher <[EMAIL PROTECTED]> wrote:


Hello Session,

See replies in context below -

> -Original Message-
> From: Session Mwamufiya [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 26, 2007 11:58 PM
> To: 'Struts Users Mailing List'
> Subject: Struts 2 Login example using a session
>
> Hi,
>
> I tried to follow the simple login example at
> http://struts.apache.org/2.x/docs/simplelogin-with-session.html, but
there are many
> things that I don't get:
> - first, it's written for webworks, not struts 2, are there any
compatibility issues between the two?

I read that page and I would say that other than using  - second, the session is never set with a timeout attribute, how do we
actually enforce a timeout?

The session timeout period is controlled by the app server as far as I
know. For instance, I have the following using Tomcat4 -


480


> - third, do we need to include a line like  at the
> beginning of every jsp file in our web app to check whether the user
is still logged in; or is there
> a more general way of ensuring that.

I took a different approach than the authors of that page (and may
update the wiki with my code if people feel it is appropriate. First
off, I created a global result named "login" in a global package. When
this result is encountered, it redirects to the Login action. Next, I
created a class that implemented SessionAware and put all of the login
logic in that class. Every action that needs to enforce a login inherits
from that class. With my way, you can avoid includes... If I don't want
to inherit from that "Authenticated" action, I can create a custom tag
with the same logic (check the session for a user object, if not there,
redirect to the Login action).




Thanks,

Session A. Mwamufiya
Carnegie Mellon University
MBA | Tepper School of Business
MSE (software eng.) | School of Computer Science
T: (412) 508-5455 | [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]




Re: S2: autocompletion trouble in 2.0.8

2007-06-26 Thread Toni Lyytikäinen

Try removing the last comma from the list like this:

[
   ["ALABAMA STATE UNIV HORNETS"],
   ["ALBANY ST UNIV GOLDEN RAMS"],
   ["BALDWIN-WALLCE CLG YELLW JCKTS"],
   ["BALL ST UNIV CARDINALS"],
   ["BAYLOR UNIV BEARS"],
   ["CATAWBA COLLEGE"]   <-- removed comma
]

On 6/26/07, Scott Nesbitt <[EMAIL PROTECTED]> wrote:



Using the following code:



 

I am getting what looks like a Dojo error: Object
error  at line 4871.

Here is what Fiddler says is the JSON I return:

[
["ALABAMA STATE UNIV HORNETS"],
["ALBANY ST UNIV GOLDEN RAMS"],
["BALDWIN-WALLCE CLG YELLW JCKTS"],
["BALL ST UNIV CARDINALS"],
["BAYLOR UNIV BEARS"],
["CATAWBA COLLEGE"],
]

Any ideas?  Strangely, this works on a WIN2K machine
with IE6, but fails on a WINXP machine with IE6, both
with the latest patches.

Thanks,

Scott





Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: integration of hibernate3 in struts2

2007-06-21 Thread Toni Lyytikäinen

What kind of filter are you using? Have you made one yourself or is it the
one from the Spring framework? If not, consider looking into Spring. Spring
includes an OSIV filter that seems to work for me at least. I'm also using
the Spring declarative transactions in my DAOs which makes writing database
access code a lot less tedious. You'll also get the nice IoC container if
you integrate Spring into your application.

On 6/21/07, Roberto Nunnari <[EMAIL PROTECTED]> wrote:


Hello.

I'd like to ask if anyone can share his experience in integrating
hibernate3 in S2.

I believe I should use the 'Open Session in View Pattern' but
as I'm getting wierd behaviour from my S2 application I wonder
if the way I'm integrating it is bad.

I'm using a filter for hibernate in web.xml.. should I instead
use a S2 interceptor?

Any other way?

Please help!

Thank you.

--
Robi


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]