Re: Struts URLs for perfectionists like Ebay's URLs

2007-09-19 Thread Vo Van Thuong

Hi Vinny,

I'd like users to access to my website by URLs like Ebay's:
http://listings.ebay.com/_W0QQcoactionZcompareQQcoentrypageZsearchQQcopagenumZ1QQfromZR2QQftrtZ1QQftrvZ1QQsabfmtsZ1QQsacatZQ2d1QQsaobfmtsZinsifQQsocmdZListingCategoryList
In which we can't see which one is get parameters which one is value 
obviously.


I've already read an article at 
http://www.lunatech-research.com/archives/2005/07/29/struts-urls
Which gives guides to remove the request extension (.do), the parameter and 
value from urls.

eg:
   customer.do?method=edit&id=42
   /customer/edit/42

Thanks for quick response.

- Original Message - 
From: "Vinny" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Thursday, September 20, 2007 12:54 PM
Subject: Re: Struts URLs for perfectionists like Ebay's URLs



Can you give an example of what you are trying to do?
There a few plugins/tools/filters that can effect urls in struts and
webapps in general




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



Re: set value of the datetimepicker but the value does not appear in the input box

2007-09-19 Thread Abhinav

Try this :

var vDate = dojo.widget.byId("validateDate");
vDate.inputNode.value = '2007-01-01';



Andvar Woo wrote:

Thanks for your reply,but the problem still exists: the value do be set--a
alert statement shows
that,but the input box still displays nothing: just a blank,the
datetimepicker does not work either--i cannot select a new date,the dropdown
date-select panel does not appear when click
the date icon.


2000/9/20, Martin Gainty <[EMAIL PROTECTED]>:
  

Andvar-
Date date = new Date("Sat, 01 Jan 2007 13:30:00 GMT");

and then once you acquire the id call setDate as in
dojo.byId(id).setDate(date);

courtesy of a posting by musachy

http://mail-archives.apache.org/mod_mbox/struts-user/200705.mbox/[EMAIL 
PROTECTED]

HTH/
M--

- Original Message -
From: "Andvar Woo" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, September 19, 2007 10:13 PM
Subject: set value of the datetimepicker but the value does not appear in
the input box




hi all,
i want to set the value of a datetimepicker in javasript but
  

encounter


a problem. i do that like this: first use ajax to
get a record as a "json" object,then use the "json" object to initialize
  

a


form, which contains a datetimepicker.
the form is used to add a new record and to modify a select record.

the main code is as follows

//the datetimepicker i want to set value,the   is
included in the head tags.


//the js to set value of datetimepicker
 function modify()
{
var vDate = dojo.widget.byId("validateDate");

 vDate.setValue('2007-01-01');

 alert(vDate.getValue());

}
the value do be set because the 'alert(vDate.getValue())'  shows the
  

value


'2007-01-01',the problem is the input box of the datetimepicker displays
nothing,and i couldnot select a new date either,something like the
datetimepicker is disabled,( is included in the
  

head


tags,the datetimepicker works well when add a record in the form)
does anyone knows how to handle this problem?
many thanks.

  

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





  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 9/19/2007 3:59 PM
  



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



Re: can't cast an object back from session

2007-09-19 Thread meissa . sakho

Yes, when I try casting it like you this,
 User user=(User)getSession().get(Constantes.USER_SESSION_KEY);
I'm getting a ClassCastException.
The debugger clearly shows me the right name I'm waiting for.
It's very strange.
Meissa



wild_oscar <[EMAIL PROTECTED]> 
19/09/2007 17:36
Veuillez répondre à
"Struts Users Mailing List" 


A
user@struts.apache.org
cc

Objet
Re: can't cast an object back from session







Did you try casting it directly, like:

User user=(User)getSession().get(Constantes.USER_SESSION_KEY);

?

If not, try logging (or debug to it) the class name of the object you've
got:

getSession().getAttribute("aa").getClass().getCanonicalName() (or 
getName())

Loggers and debuggers are great for this...



meissa.sakho-2 wrote:
> 
> 
> I'm troubleshooted with this starnge behaviour of the session.
> I have implemented SessionAware and have defined a session attribute of 
> Map type with getter (and setter)
> as indicated to handle session.
> 
> I'm putting a User objet to the session and want to retrieve it after 
some 
> steps.
> The code below gives me an Object that is already well typed.
> 
> Object user=getSession().get(Constantes.USER_SESSION_KEY);
> 
> 
> I'm seeing the object  but when I try to Cast it, like that
> 
> user=(User)user;
> 
>  I'm getting a ClasscastException.
> 
> What am I missing here ?
> why can't we cast objects from the session.
> 
> Meissa
> 
> 
> L'integrite de ce message n'etant pas assuree sur internet, Natixis ne
> peut etre tenu responsable de son contenu. Toute utilisation ou 
diffusion
> non autorisee est interdite. Si vous n'etes pas destinataire de ce
> message, merci de le detruire et d'avertir l'expediteur.
> Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails
> que si necessaire
> 
> The integrity of this message cannot be guaranteed on the Internet.
> Natixis can not therefore be considered responsible for the contents. 
Any
> unauthorized use or dissemination is prohibited. If you are not the
> intended recipient of this message, then please delete it and notify the
> sender.
> Let us mind the environment : let's print our mails only when necessary.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/can%27t-cast-an-object-back-from-session-tf4481550.html#a12779996

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


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




L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut 
etre tenu responsable de son contenu. Toute utilisation ou diffusion non 
autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci 
de le detruire et d'avertir l'expediteur.
Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si 
necessaire

The integrity of this message cannot be guaranteed on the Internet. Natixis can 
not therefore be considered responsible for the contents. Any unauthorized use 
or dissemination is prohibited. If you are not the intended recipient of this 
message, then please delete it and notify the sender.


Re: Struts URLs for perfectionists like Ebay's URLs

2007-09-19 Thread Vinny
Can you give an example of what you are trying to do?
There a few plugins/tools/filters that can effect urls in struts and
webapps in general

On 9/20/07, Vo Van Thuong <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I'm very interested in Ebay's Urls,
> would someone pls give me some ideas about Ebay's Urls.
>
> why they do that and can i also make my Urls like Ebay's?
>
> Thanks
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
The Street Programmer http://streetprogrammer.com


Struts URLs for perfectionists like Ebay's URLs

2007-09-19 Thread Vo Van Thuong

Hi,
I'm very interested in Ebay's Urls,
would someone pls give me some ideas about Ebay's Urls.

why they do that and can i also make my Urls like Ebay's?

Thanks

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



Re: [OT] Ajax recommendations for use with Struts1.1

2007-09-19 Thread Frank W. Zammetti

Roger Ye wrote:

Hi Frank,

I'm interested in the experience with DWR and Dojo you have got,
so why are you trying to move away from Dojo? then move to which?
is is DWR?


Let me begin by giving the caveat that we started with Dojo 0.3.1, and 
have never had the time to upgrade, so we're still on that version. 
We've also had to make quite a few custom mods (not just a custom build, 
actual Dojo code changes) to it to get it to do everything we needed, 
which makes upgrading that much harder.  For reference, we're using 
dojo.io.bind, plus some widgets (tab, calendar, button, floating pane 
and menu).  We used to use the button widget too, but swapped that out 
for performance reasons, believe it or not!


We're moving away from Dojo because of one realization: it's better to 
build with best-of-breed products than to try and grab one do-it-all 
product.  We choose Dojo initially for two reasons.  One, it was gaining 
a lot of steam at the time we made the decision, and two, because of the 
nature of our development team (they had no RIA development experience 
and didn't have a ton of Struts experience either), we felt it would be 
better to have one library that did everything we needed.  We decided we 
wanted to use Struts (1.2.7) because there was at least *some* 
familiarity on the team with it, so we needed to find some method of 
AJAX that could co-exist with it, so DWR wasn't the best choice at the 
time either.  And really there was a third reason: there was no dominant 
Javascript/AJAX library really, but Dojo seemed to be on its way to 
becoming that (and still may be), so there really wasn't a *whole* lot 
of choice, given some of our challenges.


And since someone is bound to ask, we considered AjaxParts of course, 
would be crazy if we didn't consider the project I started!  We decided 
against it because the nature of the app we were charged with building 
would have required a ton of custom handlers to be coded, and when you 
get to that point, the benefits of APT start to melt away.


We had our problems with Dojo along the way ranging from performance to 
bugs to missing features.  But again, to be fair, we're talking about a 
fairly old version at this point.  We overcame all of these, and the app 
is very highly regarded now, so the choice hasn't actually hurt us in 
any big way.


The drive towards DWR is coming from me specifically because it starts 
you down a path of an architecture that makes a ton of sense to me: 
best-of-breed widgets and support libraries on the client, and nothing 
but POJOs on the server.  No framework like Struts to learn, no 
complicated Javascript to learn (at least for the remoting part of the 
equation) and very quick turn-around times because writing a POJO is 
quicker than anything Struts can offer (and the less said about EJBs, 
even 3.0 beans, the better).  Mix in the right widgets and you can get 
an incredibly rich webapp up and running in almost no time at all.


I'm also introducing Spring to a lot of people little by little (and 
learning it myself little by little), as part of our developing 
reference architecture, so we get a lot of benefit there too, and it 
integrates nicely with DWR.


We're finding that a lot of the things we thought would be problems, 
like the desire to have method-level access control like you get with 
EJBs, is not much more work in this model.  There are still some 
challenges of course (like not having il8n automatically like you can 
have with Struts), but overall it's working out very well.



I've used DWR in a previous project, for me it's quite good, gotta love it,
however, in the current project we use Struts 2 and Struts 2 seems to have
some connection with Dojo, so I appreciate a lot if you could share your
story with Dojo.


I can't talk intelligently (as if that ever stops me!) about the AJAX 
support in S2 because I only have some "playground" experience with 
it... I've yet to use S2 in a real project that wasn't contrived for my 
own benefit... then again, with this simple DWR-based architecture 
gaining steam, I may never have to.  Ironically, S2 does a lot of what 
we did in our project: abstracts away the details of Dojo.  We pretty 
much built an API around Dojo so that our more junior developers barely 
knew they were using Dojo.  Some of this was taglibs (especially where 
widgets were involved), other parts of it was a Javascript API that is 
more business/function-oriented, so for instance, instead of having to 
worry about how to do an AJAX call with Dojo, you instead call our 
submitFormTargetTab() method, and that would deal with all the details 
and put the results in the specified tab on the screen (plus it deals 
with a lot of other related things that don't have to do with Dojo).


Well, that's my .0006 cents on things.


Thanks
Roger


Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

Re: set value of the datetimepicker but the value does not appear in the input box

2007-09-19 Thread Andvar Woo
Thanks for your reply,but the problem still exists: the value do be set--a
alert statement shows
that,but the input box still displays nothing: just a blank,the
datetimepicker does not work either--i cannot select a new date,the dropdown
date-select panel does not appear when click
the date icon.


2000/9/20, Martin Gainty <[EMAIL PROTECTED]>:
>
> Andvar-
> Date date = new Date("Sat, 01 Jan 2007 13:30:00 GMT");
>
> and then once you acquire the id call setDate as in
> dojo.byId(id).setDate(date);
>
> courtesy of a posting by musachy
>
> http://mail-archives.apache.org/mod_mbox/struts-user/200705.mbox/[EMAIL 
> PROTECTED]
>
> HTH/
> M--
>
> - Original Message -
> From: "Andvar Woo" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, September 19, 2007 10:13 PM
> Subject: set value of the datetimepicker but the value does not appear in
> the input box
>
>
> > hi all,
> > i want to set the value of a datetimepicker in javasript but
> encounter
> > a problem. i do that like this: first use ajax to
> > get a record as a "json" object,then use the "json" object to initialize
> a
> > form, which contains a datetimepicker.
> > the form is used to add a new record and to modify a select record.
> >
> > the main code is as follows
> >
> > //the datetimepicker i want to set value,the   is
> > included in the head tags.
> >  >  name="blacklist.validateDate" displayFormat="-MM-dd" />
> >
> > //the js to set value of datetimepicker
> >  function modify()
> > {
> > var vDate = dojo.widget.byId("validateDate");
> >
> >  vDate.setValue('2007-01-01');
> >
> >  alert(vDate.getValue());
> >
> > }
> > the value do be set because the 'alert(vDate.getValue())'  shows the
> value
> > '2007-01-01',the problem is the input box of the datetimepicker displays
> > nothing,and i couldnot select a new date either,something like the
> > datetimepicker is disabled,( is included in the
> head
> > tags,the datetimepicker works well when add a record in the form)
> > does anyone knows how to handle this problem?
> > many thanks.
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: set value of the datetimepicker but the value does not appear in the input box

2007-09-19 Thread Martin Gainty

Andvar-
Date date = new Date("Sat, 01 Jan 2007 13:30:00 GMT");

and then once you acquire the id call setDate as in
dojo.byId(id).setDate(date);

courtesy of a posting by musachy
http://mail-archives.apache.org/mod_mbox/struts-user/200705.mbox/[EMAIL 
PROTECTED]

HTH/
M--

- Original Message - 
From: "Andvar Woo" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, September 19, 2007 10:13 PM
Subject: set value of the datetimepicker but the value does not appear in 
the input box




hi all,
i want to set the value of a datetimepicker in javasript but encounter
a problem. i do that like this: first use ajax to
get a record as a "json" object,then use the "json" object to initialize a
form, which contains a datetimepicker.
the form is used to add a new record and to modify a select record.

the main code is as follows

//the datetimepicker i want to set value,the   is
included in the head tags.


//the js to set value of datetimepicker
 function modify()
{
var vDate = dojo.widget.byId("validateDate");

 vDate.setValue('2007-01-01');

 alert(vDate.getValue());

}
the value do be set because the 'alert(vDate.getValue())'  shows the value
'2007-01-01',the problem is the input box of the datetimepicker displays
nothing,and i couldnot select a new date either,something like the
datetimepicker is disabled,( is included in the head
tags,the datetimepicker works well when add a record in the form)
does anyone knows how to handle this problem?
many thanks.




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



set value of the datetimepicker but the value does not appear in the input box

2007-09-19 Thread Andvar Woo
hi all,
 i want to set the value of a datetimepicker in javasript but encounter
a problem. i do that like this: first use ajax to
get a record as a "json" object,then use the "json" object to initialize a
form, which contains a datetimepicker.
the form is used to add a new record and to modify a select record.

the main code is as follows

//the datetimepicker i want to set value,the   is
included in the head tags.
 

//the js to set value of datetimepicker
  function modify()
{
 var vDate = dojo.widget.byId("validateDate");

  vDate.setValue('2007-01-01');

  alert(vDate.getValue());

}
the value do be set because the 'alert(vDate.getValue())'  shows the value
'2007-01-01',the problem is the input box of the datetimepicker displays
nothing,and i couldnot select a new date either,something like the
datetimepicker is disabled,( is included in the head
tags,the datetimepicker works well when add a record in the form)
does anyone knows how to handle this problem?
many thanks.


Re: [OT] Ajax recommendations for use with Struts1.1

2007-09-19 Thread Roger Ye
Hi Frank,

I'm interested in the experience with DWR and Dojo you have got,
so why are you trying to move away from Dojo? then move to which?
is is DWR?

I've used DWR in a previous project, for me it's quite good, gotta love it,
however, in the current project we use Struts 2 and Struts 2 seems to have
some connection with Dojo, so I appreciate a lot if you could share your
story with Dojo.

Thanks
Roger



On 9/20/07, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>
> Hi Rick,
>
> AjaxParts is still a good alternative, especially given your past
> experience.  It's still very much alive, and probably even a bit better
> than the last time you used it.
>
> As Adam said, DWR is another alternative I think very highly of as well
> (highly enough to be nearing completion of a book about it).
>
> We've used Dojo at work with good success, although I've always had a
> little bit of unease with it (and we're actually trying to move away
> from it little by little), but that shouldn't dissuade you from checking
> it out (especially if you just need AJAX out of it, I think you could be
> OK with it).  Prototype is always a good option, very minimal and easy
> to use.
>
> I'd personally look at what you want/have to do... if you still want to
> stay away from Javascript as much as possible, that's always been an
> area that AjaxParts excels in (and I think doesn't have too many rivals
> in that regard frankly).
>
> If you have some leeway though, you can have a very compelling
> architecture with DWR and Spring mixed in.  You find that you really
> don't need any framework at all, and the code you write is very elegant.
>   This is the direction I'm pushing at work, and I'm getting some
> traction given some early successes with the concept.
>
> With the restrictions you have though, AjaxParts might be your best bet,
> especially if keeping the Javascript you have to write to a minimum is
> something important to you.  It'll still I think require the least
> amount of effort to work with Struts 1.1 your using, require the least
> amount of change to anything that may already exist.  DWR leads down a
> different path, and most of the other options, I believe, don't really
> offer anything all that different from one another.  There's always GWT
> too, although if you have to use Struts I'm not sure what integration
> options there are (nor am I sure you could use the older JDK version).
> I'm not aware of any other options that would, were I in your shoes, get
> me all that excited.
>
> Frank
>
> Rick Reumann wrote:
> > Hey all, unfortunately I'm going to be stuck on a new project has to use
> > Struts1.1 - not that I'm against Struts it's just that I'd rather use
> > something less archaic like Struts2 -   We have to run on an old server(
> > Weblogic8.1), won't upgrade to java5, servletspec2.3/jsp1.2), have to
> use
> > offshore help, etc, they want to use struts1.1.  I'm prefacing it with
> that
> > because I'm looking for suggestions in dealing with several components
> that
> > are going to have to rely on using Ajax. I'd like to know some of your
> > recommendations. I've had great experience in the past with AjaxParts (
> > http://javawebparts.sourceforge.net/) and will probably use them again -
> but
> > being out of the front-end loop for a long time, I could be missing out
> on
> > some other ajax libraries that have come out recently.
> >
> > Just a few caveats...
> >
> > 1) Has to run using some older specs (Java1.4, Servlet2.3/JSP1.2 )
> > 2) I'd rather have easy to use and customize over a 'full featured
> gigantic
> > suite of components."
> >
> > Thanks for any recommendations.
> >
> >
> >
> > 
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date:
> 9/18/2007 11:53 AM
>
> --
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> and "JavaScript, DOM Scripting and Ajax Projects"
>   (2007, Apress, ISBN 1-59059-816-4)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


RE: [struts2] Button pressed

2007-09-19 Thread Jason Wyatt
Hi Marcos, 

In my understanding you can use a String instead of a boolean:

Action:

private String submit;

public void setSubmit(String submit) {
this.submit = submit;
}

And in the JSP:

 

 


Note there is a bug in 2.0.9 that this doesn't work for ajax-themed submit
buttons.

Regards
Jason


-
Falun Dafa  Truth - Compassion - Forbearance

A mind & body practice under persecution in China

http://www.faluninfo.net




-Original Message-
From: Marcos Mendonça [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 20 September 2007 6:34 AM
To: Struts Users Mailing List
Subject: [struts2] Button pressed

Hello

I've tried following this
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html, to determine
in my validate() method of my action to check wich button was pressed, It
doesn't seem to work though.

private boolean selecaoOk = false;

public void setSelecaoOk(boolean selecaoOk) {
this.selecaoOk = selecaoOk;
}

And in my jsp:



But when the form is submitted the selecaoOk variable is false.

Has anyone succeed in determing wich button was pressed with Struts2.0.9?

Any tips?

Thanks

-
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: [OT] Ajax recommendations for use with Struts1.1

2007-09-19 Thread Frank W. Zammetti

Hi Rick,

AjaxParts is still a good alternative, especially given your past 
experience.  It's still very much alive, and probably even a bit better 
than the last time you used it.


As Adam said, DWR is another alternative I think very highly of as well 
(highly enough to be nearing completion of a book about it).


We've used Dojo at work with good success, although I've always had a 
little bit of unease with it (and we're actually trying to move away 
from it little by little), but that shouldn't dissuade you from checking 
it out (especially if you just need AJAX out of it, I think you could be 
OK with it).  Prototype is always a good option, very minimal and easy 
to use.


I'd personally look at what you want/have to do... if you still want to 
stay away from Javascript as much as possible, that's always been an 
area that AjaxParts excels in (and I think doesn't have too many rivals 
in that regard frankly).


If you have some leeway though, you can have a very compelling 
architecture with DWR and Spring mixed in.  You find that you really 
don't need any framework at all, and the code you write is very elegant. 
 This is the direction I'm pushing at work, and I'm getting some 
traction given some early successes with the concept.


With the restrictions you have though, AjaxParts might be your best bet, 
especially if keeping the Javascript you have to write to a minimum is 
something important to you.  It'll still I think require the least 
amount of effort to work with Struts 1.1 your using, require the least 
amount of change to anything that may already exist.  DWR leads down a 
different path, and most of the other options, I believe, don't really 
offer anything all that different from one another.  There's always GWT 
too, although if you have to use Struts I'm not sure what integration 
options there are (nor am I sure you could use the older JDK version). 
I'm not aware of any other options that would, were I in your shoes, get 
me all that excited.


Frank

Rick Reumann wrote:

Hey all, unfortunately I'm going to be stuck on a new project has to use
Struts1.1 - not that I'm against Struts it's just that I'd rather use
something less archaic like Struts2 -   We have to run on an old server(
Weblogic8.1), won't upgrade to java5, servletspec2.3/jsp1.2), have to use
offshore help, etc, they want to use struts1.1.  I'm prefacing it with that
because I'm looking for suggestions in dealing with several components that
are going to have to rely on using Ajax. I'd like to know some of your
recommendations. I've had great experience in the past with AjaxParts (
http://javawebparts.sourceforge.net/) and will probably use them again - but
being out of the front-end loop for a long time, I could be missing out on
some other ajax libraries that have come out recently.

Just a few caveats...

1) Has to run using some older specs (Java1.4, Servlet2.3/JSP1.2 )
2) I'd rather have easy to use and customize over a 'full featured gigantic
suite of components."

Thanks for any recommendations.





No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 9/18/2007 11:53 AM


--
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
and "JavaScript, DOM Scripting and Ajax Projects"
 (2007, Apress, ISBN 1-59059-816-4)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

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



struts1 taglibs and struts2

2007-09-19 Thread Adam Hardy
The old struts1 HTML taglibs have a 'titleKey' attribute, for putting an 
internationalised title on an HTML tag automatically. Others had a 'key' attribute.


Is there any intention to put this kind of attribute onto the S2 tags? I know 
there are OGNL methods to do the same thing, but 'titleKey' is so elegant.


Regards
Adam


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



Re: [OT] Ajax recommendations for use with Struts1.1

2007-09-19 Thread Adam Hardy

Hi Rick,

DWR is highly useful for getting your pojos across to the client-side and back 
again.



Adam

Rick Reumann on 19/09/07 23:23, wrote:

Hey all, unfortunately I'm going to be stuck on a new project has to use
Struts1.1 - not that I'm against Struts it's just that I'd rather use
something less archaic like Struts2 -   We have to run on an old server(
Weblogic8.1), won't upgrade to java5, servletspec2.3/jsp1.2), have to use
offshore help, etc, they want to use struts1.1.  I'm prefacing it with that
because I'm looking for suggestions in dealing with several components that
are going to have to rely on using Ajax. I'd like to know some of your
recommendations. I've had great experience in the past with AjaxParts (
http://javawebparts.sourceforge.net/) and will probably use them again - but
being out of the front-end loop for a long time, I could be missing out on
some other ajax libraries that have come out recently.

Just a few caveats...

1) Has to run using some older specs (Java1.4, Servlet2.3/JSP1.2 )
2) I'd rather have easy to use and customize over a 'full featured gigantic
suite of components."

Thanks for any recommendations.




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



[OT] Ajax recommendations for use with Struts1.1

2007-09-19 Thread Rick Reumann
Hey all, unfortunately I'm going to be stuck on a new project has to use
Struts1.1 - not that I'm against Struts it's just that I'd rather use
something less archaic like Struts2 -   We have to run on an old server(
Weblogic8.1), won't upgrade to java5, servletspec2.3/jsp1.2), have to use
offshore help, etc, they want to use struts1.1.  I'm prefacing it with that
because I'm looking for suggestions in dealing with several components that
are going to have to rely on using Ajax. I'd like to know some of your
recommendations. I've had great experience in the past with AjaxParts (
http://javawebparts.sourceforge.net/) and will probably use them again - but
being out of the front-end loop for a long time, I could be missing out on
some other ajax libraries that have come out recently.

Just a few caveats...

1) Has to run using some older specs (Java1.4, Servlet2.3/JSP1.2 )
2) I'd rather have easy to use and customize over a 'full featured gigantic
suite of components."

Thanks for any recommendations.

-- 
Rick


[struts2] Button pressed

2007-09-19 Thread Marcos Mendonça
Hello

I've tried following this
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html, to
determine in my validate() method of my action to check wich button
was pressed, It doesn't seem to work though.

private boolean selecaoOk = false;

public void setSelecaoOk(boolean selecaoOk) {
this.selecaoOk = selecaoOk;
}

And in my jsp:



But when the form is submitted the selecaoOk variable is false.

Has anyone succeed in determing wich button was pressed with Struts2.0.9?

Any tips?

Thanks

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



Re: can we redirect to input page after validation fails ?

2007-09-19 Thread Paul Benedict
To preserve messages across redirects, you need to do a little magic.

Struts 1.2 does not have the automatic ability to put messages into session
scope if validation fails. Instead, you should customize the Controller
(through a subclass you write) to copy any messages from the request into
the session if they are unaccessed. You should customize processValidate to
do something similar:

ActionErrors errors = validation.
if (errors are found) {
  if (errors are unaccessed) {
create session if necessary;
copy them to session;
}

This will be a standard part of the upcoming 1.4 release.

Paul

On 9/19/07, abhiram <[EMAIL PROTECTED]> wrote:
>
> it is struts 1.2, and my application server is tomcat 5.5.9
>
> Paul Benedict <[EMAIL PROTECTED]> wrote: What ver of Struts?
>
> On 9/19/07, abhiram  wrote:
> >
> > Hi!! your method works..but i am not able to see my error message..
> > i mean.. i want it to work like javascript... like display the err mesg
> > when validation fails, and once i refresh the page, display the page
> without
> > error message(the original input page)..,with url intact.
> >
> > may seem like i am greedy.. but i just want to know if it is possible..
> >
> > and thanks for such a prompt reply sir.
> >
> > Paul Benedict
> wrote: You can do it, but it's a
> > little bit more work.
> >
> > 1) Set inputForward=true on the Controller
> > 2) Convert your input attributes on the action mapping to refer to a
> > mapping
> > name.
> > 3) Add a corresponding forward.
> >
> > Example:
> >
> >
> >
> >
> >
> >
> > Paul
> >
> > On 9/19/07, abhiram  wrote:
> > >
> > > HII! i have a small doubt.. when i submit a form from a jsp called
> > > LoginForm.jsp, and if the validation fails in the validate() method of
> > the
> > > ActionForm, I am being shown LoginForm.jsp, but with URL as
> > LoginAction.do.
> > > How to avoid this ? i want it to be shown as LoginForm.jsp. can we
> > > redirect to input page after validation fails ?
> > >
> > > this is happening even after i refresh the page.. and even the error
> > > message(the custom message we try to put in the input page when a
> > validation
> > > fails) doesn't go.
> > >
> > > please help.
> > > thanks,
> > > abhiram
> > >
> > >
> > > -
> > > Get the freedom to save as many mails as you wish. Click here to know
> > how.
> >
> >
> >
> >   abhiram
> >
> >
> >
> >
> >
> > -
> > Unlimited freedom, unlimited storage. Get it now
>
>
>
>
>   abhiram
>
>
>
>
>
> -
> Get the freedom to save as many mails as you wish. Click here to know how.


Re: [S2] Autocompleter initial value and key

2007-09-19 Thread Pedro Herrera

any idea for Struts ??

herrera


rrecoba wrote:
> 
> :(... so i´ve to change all my nice autocompleters :_(
> 
> Pedro, I don´t know anything about DWR? have you did your own
> autocompleter using DWR ? or you get it from some place? do you have any
> link ?  thanks a lot.
> 
> 
> 
> 
> Pedro Herrera wrote:
>> 
>> I was having the same problem. What I did ? Autocompleter ? NO THANKS. i
>> used DWR.
>> 
>> Herrera
>> 
>> 
>> 
>> 
>> 
>> rrecoba wrote:
>>> 
>>> Please, this problem is making me crazy, I really need to solve this
>>> problem. Please HELP !!
>>> I´ve tryied a lot of things and nothing works..
>>> 
>>> Thanks.
>>> 
>>> 
>>> rrecoba wrote:
 
 Hi, I need to set an initial value and key for an autocompleter. How
 can id do this? I can set the initial value, but can´t never set the
 initial key.
 
 Thanks a lot.
 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-initial-value-and-key-tf4291467.html#a12784875
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: can we redirect to input page after validation fails ?

2007-09-19 Thread abhiram
it is struts 1.2, and my application server is tomcat 5.5.9

Paul Benedict <[EMAIL PROTECTED]> wrote: What ver of Struts?

On 9/19/07, abhiram  wrote:
>
> Hi!! your method works..but i am not able to see my error message..
> i mean.. i want it to work like javascript... like display the err mesg
> when validation fails, and once i refresh the page, display the page without
> error message(the original input page)..,with url intact.
>
> may seem like i am greedy.. but i just want to know if it is possible..
>
> and thanks for such a prompt reply sir.
>
> Paul Benedict 
 wrote: You can do it, but it's a
> little bit more work.
>
> 1) Set inputForward=true on the Controller
> 2) Convert your input attributes on the action mapping to refer to a
> mapping
> name.
> 3) Add a corresponding forward.
>
> Example:
>
>
>
>
>
>
> Paul
>
> On 9/19/07, abhiram  wrote:
> >
> > HII! i have a small doubt.. when i submit a form from a jsp called
> > LoginForm.jsp, and if the validation fails in the validate() method of
> the
> > ActionForm, I am being shown LoginForm.jsp, but with URL as
> LoginAction.do.
> > How to avoid this ? i want it to be shown as LoginForm.jsp. can we
> > redirect to input page after validation fails ?
> >
> > this is happening even after i refresh the page.. and even the error
> > message(the custom message we try to put in the input page when a
> validation
> > fails) doesn't go.
> >
> > please help.
> > thanks,
> > abhiram
> >
> >
> > -
> > Get the freedom to save as many mails as you wish. Click here to know
> how.
>
>
>
>   abhiram
>
>
>
>
>
> -
> Unlimited freedom, unlimited storage. Get it now




  abhiram




   
-
 Get the freedom to save as many mails as you wish. Click here to know how.

Re: can we redirect to input page after validation fails ?

2007-09-19 Thread Paul Benedict
What ver of Struts?

On 9/19/07, abhiram <[EMAIL PROTECTED]> wrote:
>
> Hi!! your method works..but i am not able to see my error message..
> i mean.. i want it to work like javascript... like display the err mesg
> when validation fails, and once i refresh the page, display the page without
> error message(the original input page)..,with url intact.
>
> may seem like i am greedy.. but i just want to know if it is possible..
>
> and thanks for such a prompt reply sir.
>
> Paul Benedict <[EMAIL PROTECTED]> wrote: You can do it, but it's a
> little bit more work.
>
> 1) Set inputForward=true on the Controller
> 2) Convert your input attributes on the action mapping to refer to a
> mapping
> name.
> 3) Add a corresponding forward.
>
> Example:
>
>
>
>
>
>
> Paul
>
> On 9/19/07, abhiram  wrote:
> >
> > HII! i have a small doubt.. when i submit a form from a jsp called
> > LoginForm.jsp, and if the validation fails in the validate() method of
> the
> > ActionForm, I am being shown LoginForm.jsp, but with URL as
> LoginAction.do.
> > How to avoid this ? i want it to be shown as LoginForm.jsp. can we
> > redirect to input page after validation fails ?
> >
> > this is happening even after i refresh the page.. and even the error
> > message(the custom message we try to put in the input page when a
> validation
> > fails) doesn't go.
> >
> > please help.
> > thanks,
> > abhiram
> >
> >
> > -
> > Get the freedom to save as many mails as you wish. Click here to know
> how.
>
>
>
>   abhiram
>
>
>
>
>
> -
> Unlimited freedom, unlimited storage. Get it now


Re: can we redirect to input page after validation fails ?

2007-09-19 Thread abhiram
Hi!! your method works..but i am not able to see my error message..
i mean.. i want it to work like javascript... like display the err mesg when 
validation fails, and once i refresh the page, display the page without error 
message(the original input page)..,with url intact.

may seem like i am greedy.. but i just want to know if it is possible..

and thanks for such a prompt reply sir.

Paul Benedict <[EMAIL PROTECTED]> wrote: You can do it, but it's a little bit 
more work.

1) Set inputForward=true on the Controller
2) Convert your input attributes on the action mapping to refer to a mapping
name.
3) Add a corresponding forward.

Example:



  


Paul

On 9/19/07, abhiram  wrote:
>
> HII! i have a small doubt.. when i submit a form from a jsp called
> LoginForm.jsp, and if the validation fails in the validate() method of the
> ActionForm, I am being shown LoginForm.jsp, but with URL as LoginAction.do.
> How to avoid this ? i want it to be shown as LoginForm.jsp. can we
> redirect to input page after validation fails ?
>
> this is happening even after i refresh the page.. and even the error
> message(the custom message we try to put in the input page when a validation
> fails) doesn't go.
>
> please help.
> thanks,
> abhiram
>
>
> -
> Get the freedom to save as many mails as you wish. Click here to know how.



  abhiram




   
-
 Unlimited freedom, unlimited storage. Get it now

Re: can we redirect to input page after validation fails ?

2007-09-19 Thread Paul Benedict
You can do it, but it's a little bit more work.

1) Set inputForward=true on the Controller
2) Convert your input attributes on the action mapping to refer to a mapping
name.
3) Add a corresponding forward.

Example:



  


Paul

On 9/19/07, abhiram <[EMAIL PROTECTED]> wrote:
>
> HII! i have a small doubt.. when i submit a form from a jsp called
> LoginForm.jsp, and if the validation fails in the validate() method of the
> ActionForm, I am being shown LoginForm.jsp, but with URL as LoginAction.do.
> How to avoid this ? i want it to be shown as LoginForm.jsp. can we
> redirect to input page after validation fails ?
>
> this is happening even after i refresh the page.. and even the error
> message(the custom message we try to put in the input page when a validation
> fails) doesn't go.
>
> please help.
> thanks,
> abhiram
>
>
> -
> Get the freedom to save as many mails as you wish. Click here to know how.


can we redirect to input page after validation fails ?

2007-09-19 Thread abhiram
HII! i have a small doubt.. when i submit a form from a jsp called 
LoginForm.jsp, and if the validation fails in the validate() method of the 
ActionForm, I am being shown LoginForm.jsp, but with URL as LoginAction.do. How 
to avoid this ? i want it to be shown as LoginForm.jsp. can we redirect to 
input page after validation fails ? 

this is happening even after i refresh the page.. and even the error 
message(the custom message we try to put in the input page when a validation 
fails) doesn't go.

please help.
thanks,
abhiram

   
-
 Get the freedom to save as many mails as you wish. Click here to know how.

Re: Reload a page after ActionForm

2007-09-19 Thread Paul Benedict
You can set redirect=true on the action mapping.

On 9/19/07, Diego Ezquerro <[EMAIL PROTECTED]> wrote:
>
> Hi to everybody.
>
> I have a JSP that has a Tree that is modified by a submit button that
> sends data to an ActionForm.
> Inside this ActionForm class, the tree is modified but only if the page is
> reloaded the tree is visually modified.
>
> How can I reload the page after de mapping.findForward sentence?
>
> Thanks a lot.
>
> Diego Ezquerro Bailac
> Asturias, Spain
>
>
>
> __
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/


Reload a page after ActionForm

2007-09-19 Thread Diego Ezquerro
Hi to everybody.

I have a JSP that has a Tree that is modified by a submit button that sends 
data to an ActionForm.
Inside this ActionForm class, the tree is modified but only if the page is 
reloaded the tree is visually modified.

How can I reload the page after de mapping.findForward sentence?

Thanks a lot.
 
Diego Ezquerro Bailac
Asturias, Spain



__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 

Re: [S2] action mappings help

2007-09-19 Thread Eugen Stoianovici

Thanks,
I added
REQUEST
REDIRECT
in my web.xml file for filter-mapping. Which made perfect sense right 
after i read it.


Cory D. Wiles wrote:

If you are trying to truly redirect then the below line is your problem.  It
is trying to forward not redirect.
""

Use:

<%
String redirectAction = "/myapp/subfolder/welcome.action";
response.sendRedirect(redirectAction);
%>

On 9/19/07, Eugen Stoianovici <[EMAIL PROTECTED]> wrote:
  

I'm trying to create an index with an action mapped to it for a
subfolder in my webapp. The ideea was to create a index.jsp file that has:


so it redirects me to a mapped action. The problem is that even though
the url is correct, i get a
"The requested resource (/myapp/subfolder/welcome.action) is not
available" from my server.

If i point my browser to http://website/myapp/subfolder/welcome.action
(ie: if i type this in) everything works out just fine. What am i doing
wrong?

Thanks
Eugen Stoianovici

-
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] Odd taglib behaviour with single character comparisons

2007-09-19 Thread Chris Pratt
Not sure where, but I remember reading that OGNL converts single
characters in single quotes to the Character wrapper type, which may
explain what you're seeing.  In the first case "1" != '1' in Java
since one is a String and one is a char, same is true here.

Was there anything in the logs about 3 & 7 throwing exceptions?
That's the only reason I can think of that they wouldn't print.
  (*Chris*)

On 9/19/07, Mark McLaren <[EMAIL PROTECTED]> wrote:
> I hope someone can explain the following behaviour to me.  Using the
> S2 taglibs and OGNL is starting to confuse me somewhat.  I have a test
> JSP that I am accessing via the default ActionSupport class:
>
> <[EMAIL PROTECTED] uri="http://java.sun.com/jstl/core"; prefix="c"%>
> <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>  If I call my page via  "test.action?input=1".  I get:
>
>1. true
>2. true
>3. false
>4. true
>
>5. false
>6. false
>7. false
>8. false
>
> Why is result 3 false?  If I then call my page via
> "test.action?input=a".  I get:
>
>1. false
>2. false
>3.
>4. false
>
>5. true
>6. true
>7.
>8. true
>
> Why are the result of 3 and 7 results now blank?  I have no idea what
> is going on here, is this a bug?
>
> It seems to only happen when I'm evaluating against a single
> character.  I'm guessing it is some kind of char to String comparison
> problem.  It would feel very odd if I had to start using single quotes
> around my taglib attributes (I usually need double quotes for
> XML/XHTML attributes).
>
> Thanks,
>
> Mark
>
> --
> "Paradoxically, the more time saving abstractions you are using the
> more you actually have to know." - Simon Willison
>
> -
> 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: can't cast an object back from session

2007-09-19 Thread wild_oscar

Did you try casting it directly, like:

User user=(User)getSession().get(Constantes.USER_SESSION_KEY);

?

If not, try logging (or debug to it) the class name of the object you've
got:

getSession().getAttribute("aa").getClass().getCanonicalName() (or getName())

Loggers and debuggers are great for this...



meissa.sakho-2 wrote:
> 
> 
> I'm troubleshooted with this starnge behaviour of the session.
> I have implemented SessionAware and have defined a session attribute of 
> Map type with getter (and setter)
> as indicated to handle session.
> 
> I'm putting a User objet to the session and want to retrieve it after some 
> steps.
> The code below gives me an Object that is already well typed.
> 
> Object user=getSession().get(Constantes.USER_SESSION_KEY);
> 
> 
> I'm seeing the object  but when I try to Cast it, like that
> 
> user=(User)user;
> 
>  I'm getting a ClasscastException.
> 
> What am I missing here ?
> why can't we cast objects from the session.
> 
> Meissa
> 
> 
> L'integrite de ce message n'etant pas assuree sur internet, Natixis ne
> peut etre tenu responsable de son contenu. Toute utilisation ou diffusion
> non autorisee est interdite. Si vous n'etes pas destinataire de ce
> message, merci de le detruire et d'avertir l'expediteur.
> Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails
> que si necessaire
> 
> The integrity of this message cannot be guaranteed on the Internet.
> Natixis can not therefore be considered responsible for the contents. Any
> unauthorized use or dissemination is prohibited. If you are not the
> intended recipient of this message, then please delete it and notify the
> sender.
> Let us mind the environment : let's print our mails only when necessary.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/can%27t-cast-an-object-back-from-session-tf4481550.html#a12779996
Sent from the Struts - User mailing list archive at Nabble.com.


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



Sw2 tutorial

2007-09-19 Thread Slattery, Tim - BLS
There is no Action mapped for namespace / and action name HelloWorld.

I think I see it. Struts.xml has to be in WEB-INF/classes, not where
struts-config.xml was in Struts 1.



--
Tim Slattery
[EMAIL PROTECTED]



Re: S2 tutorial

2007-09-19 Thread wild_oscar

Did you try writting "helloWorld" (with small h) as the action name in your
struts.xml file?


Slattery, Tim - BLS wrote:
> 
> I cannot make the first step of the struts 2 tutorial work. I've got
> web.xml, struts.xml, and the HelloWorld.java just as on the page. When I
> invoke the app, I get
> 
> There is no Action mapped for namespace / and action name HelloWorld.
> 
> What does that mean?
> 
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/S2-tutorial-tf4481699.html#a12779895
Sent from the Struts - User mailing list archive at Nabble.com.


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



S2 tutorial

2007-09-19 Thread Slattery, Tim - BLS
I cannot make the first step of the struts 2 tutorial work. I've got
web.xml, struts.xml, and the HelloWorld.java just as on the page. When I
invoke the app, I get

There is no Action mapped for namespace / and action name HelloWorld.

What does that mean?


--
Tim Slattery
[EMAIL PROTECTED]



Re: Struts tags help

2007-09-19 Thread wild_oscar

Not really. 
I stumbled upon this doubt when developing my application.
I have a List of Principals on my session. The first element is a
UserPrincipal and the rest are RolePrincipal.
What I want is to simply have in a JSP:

Welcome, USERNAME

And I want to retrieve USERNAME from that list. Which, in Java, is something
like Principals[0].getName()

or iterate through the principals List, see if the Principal is of instance
UserPrincipal and, if true, return the current principal's name.

On a general idea, I'm trying to find:

1) How to retrieve an item from a List using OGNL

2) What's the best approach for getting users info on JSP pages, either:
   a) Getting them like 

  b) Developing a custom JSP tag to get these kinds of information (name,
email, etc). This would also be an exercise, as I have never developed a
custom JSP tag library.


So, any feedback on questions 1) and 2) would be great!

Randy Jonasz wrote:
> 
> Hello,
> 
> On 9/19/07, wild_oscar <[EMAIL PROTECTED]> wrote:
>>
>> Following the latest message, what is the syntax if your session
>> attribute is
>> a List of Principal objects and what you want is an attribute in
>>
>> a) the first object in the list ( principals[0].name)
>>
>> b) the first object of the child principal Principal1
>> (principal1Object.name) ?
> 
> If I understand you correctly, couldn't you just write something like
> 
> 
>  
> 
> 
> Cheers,
> 
> Randy
> 
>>
>>
>>
>> Wesley Wannemacher wrote:
>> >
>> > Try -
>> > 
>> >
>> > -Wes
>> >
>> > -Original Message-
>> > From: Diego Ezquerro [mailto:[EMAIL PROTECTED]
>> > Sent: Monday, July 30, 2007 11:30 AM
>> > To: struts
>> > Subject: Struts tags help
>> >
>> > Hi to everybody.
>> >
>> > I'm developing a web app using struts and wanna know if there is a way
>> to
>> > get the session attributes using struts tags.
>> > What i want to do is something like this (within a jsp page):
>> >
>> > <%
>> > User user = (User)session.getAttribute("user");
>> > out.println("Welcome " + user.getUsername() + "!");
>> > %>
>> >
>> > Gettin' the user attribute and then have it available in the whole
>> page.
>> > I've tried  but it doesn't work fine.
>> >
>> > Thanks for the answers.
>> >
>> >
>> >
>> > __
>> > Correo Yahoo!
>> > Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
>> > Regístrate ya - http://correo.espanol.yahoo.com/
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Struts-tags-help-tf4177812.html#a12778998
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Oscar Developer
> McMaster University
> 75 Frid Street, Hamilton, ON
> 905 525 9140 x27735
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-tags-help-tf4177812.html#a12779691
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: Struts tags help

2007-09-19 Thread Randy Jonasz
Hello,

On 9/19/07, wild_oscar <[EMAIL PROTECTED]> wrote:
>
> Following the latest message, what is the syntax if your session attribute is
> a List of Principal objects and what you want is an attribute in
>
> a) the first object in the list ( principals[0].name)
>
> b) the first object of the child principal Principal1
> (principal1Object.name) ?

If I understand you correctly, couldn't you just write something like


 


Cheers,

Randy

>
>
>
> Wesley Wannemacher wrote:
> >
> > Try -
> > 
> >
> > -Wes
> >
> > -Original Message-
> > From: Diego Ezquerro [mailto:[EMAIL PROTECTED]
> > Sent: Monday, July 30, 2007 11:30 AM
> > To: struts
> > Subject: Struts tags help
> >
> > Hi to everybody.
> >
> > I'm developing a web app using struts and wanna know if there is a way to
> > get the session attributes using struts tags.
> > What i want to do is something like this (within a jsp page):
> >
> > <%
> > User user = (User)session.getAttribute("user");
> > out.println("Welcome " + user.getUsername() + "!");
> > %>
> >
> > Gettin' the user attribute and then have it available in the whole page.
> > I've tried  but it doesn't work fine.
> >
> > Thanks for the answers.
> >
> >
> >
> > __
> > Correo Yahoo!
> > Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> > Regístrate ya - http://correo.espanol.yahoo.com/
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Struts-tags-help-tf4177812.html#a12778998
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Oscar Developer
McMaster University
75 Frid Street, Hamilton, ON
905 525 9140 x27735

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



can't cast an object back from session

2007-09-19 Thread meissa . sakho

I'm troubleshooted with this starnge behaviour of the session.
I have implemented SessionAware and have defined a session attribute of 
Map type with getter (and setter)
as indicated to handle session.

I'm putting a User objet to the session and want to retrieve it after some 
steps.
The code below gives me an Object that is already well typed.

Object user=getSession().get(Constantes.USER_SESSION_KEY);


I'm seeing the object  but when I try to Cast it, like that

user=(User)user;

 I'm getting a ClasscastException.

What am I missing here ?
why can't we cast objects from the session.

Meissa


L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut 
etre tenu responsable de son contenu. Toute utilisation ou diffusion non 
autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci 
de le detruire et d'avertir l'expediteur.
Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si 
necessaire

The integrity of this message cannot be guaranteed on the Internet. Natixis can 
not therefore be considered responsible for the contents. Any unauthorized use 
or dissemination is prohibited. If you are not the intended recipient of this 
message, then please delete it and notify the sender.
Let us mind the environment : let's print our mails only when necessary.


RE: Struts tags help

2007-09-19 Thread wild_oscar

Following the latest message, what is the syntax if your session attribute is
a List of Principal objects and what you want is an attribute in

a) the first object in the list ( principals[0].name)

b) the first object of the child principal Principal1
(principal1Object.name) ?



Wesley Wannemacher wrote:
> 
> Try - 
> 
> 
> -Wes 
> 
> -Original Message-
> From: Diego Ezquerro [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 30, 2007 11:30 AM
> To: struts
> Subject: Struts tags help
> 
> Hi to everybody.
> 
> I'm developing a web app using struts and wanna know if there is a way to
> get the session attributes using struts tags.
> What i want to do is something like this (within a jsp page):
> 
> <%
> User user = (User)session.getAttribute("user");
> out.println("Welcome " + user.getUsername() + "!");
> %>
> 
> Gettin' the user attribute and then have it available in the whole page.
> I've tried  but it doesn't work fine.
> 
> Thanks for the answers.
> 
> 
> 
> __
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
> Regístrate ya - http://correo.espanol.yahoo.com/ 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-tags-help-tf4177812.html#a12778998
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: How to handle validation/errors in Ajax requests

2007-09-19 Thread Musachy Barroso
There isn't much you can do about that on 2.0, on trunk (future 2.1)
we have a new JSON validation interceptor, check this for details:

http://struts.apache.org/2.x/docs/ajax-validation.html

musachy

On 9/19/07, Marc Eckart <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I start a ajax request with a 
>
> This pumps the result in the target div tag and all is perfect. But how can
> I handle validation errors.
> They should not appear in the target div tag, instead it should appear in a
> different div tag for errors.
> Can I change the target or can I force the site to load complete instead of
> just the (with ajax) requested part.
> In case a exception occurs, can I redirect to an error page? Now the error
> page appears instead of the result in the target div.
>
> Any suggestions?
>
> Thanx in advance.
>
> Marc
>


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

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



Request Processing Chains - HOWTO... ?

2007-09-19 Thread Arne Brutschy
Hello,

I'm new to struts 1.3.x and therefore not used to the new request
processing using common-chains. I have two questions:

How do I filter/add request parameters? "In the old days" (TM) I
simply added a filter, which wrapped a RequestWrapper around the
non-writable map. How can I do that now? The structure of the context
isn't quite clear to me, and I don't know where to set the new request
wrapper object...

Second question is connected (= me not knowing where to set things):
Suppose I have authentication checker, which is called through the
servlet-standard-preprocess chain as shown here:
http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains2.html
So when the filter detects, that the user isn't logged in yet, I want
it to redirect/forward to some /login.jsp. How do I do that know?

I think I haven't got the internal structure of the request processing
yet. And informations on the process/how to use and expand it are hard
to get.. Any hints?

Arne


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



Execute Action on the server

2007-09-19 Thread Oguz Kologlu

Hi,

Does anyone know how to execute an action on the server and get the  
result on the server (without having to use something like commons  
http client).


What I want is the resulting html from an action so I send it as an  
email. I vaguely remember a way to do it with a velocity template I'd  
prefer to keep it in jsp.


Thanks,
Oz

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



Re: [S2] action mappings help

2007-09-19 Thread Cory D. Wiles
If you are trying to truly redirect then the below line is your problem.  It
is trying to forward not redirect.
""

Use:

<%
String redirectAction = "/myapp/subfolder/welcome.action";
response.sendRedirect(redirectAction);
%>

On 9/19/07, Eugen Stoianovici <[EMAIL PROTECTED]> wrote:
>
> I'm trying to create an index with an action mapped to it for a
> subfolder in my webapp. The ideea was to create a index.jsp file that has:
> 
>
> so it redirects me to a mapped action. The problem is that even though
> the url is correct, i get a
> "The requested resource (/myapp/subfolder/welcome.action) is not
> available" from my server.
>
> If i point my browser to http://website/myapp/subfolder/welcome.action
> (ie: if i type this in) everything works out just fine. What am i doing
> wrong?
>
> Thanks
> Eugen Stoianovici
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


How to handle validation/errors in Ajax requests

2007-09-19 Thread Marc Eckart
Hi,

I start a ajax request with a 

This pumps the result in the target div tag and all is perfect. But how can
I handle validation errors.
They should not appear in the target div tag, instead it should appear in a
different div tag for errors.
Can I change the target or can I force the site to load complete instead of
just the (with ajax) requested part.
In case a exception occurs, can I redirect to an error page? Now the error
page appears instead of the result in the target div.

Any suggestions?

Thanx in advance.

Marc


[s2] Odd taglib behaviour with single character comparisons

2007-09-19 Thread Mark McLaren
I hope someone can explain the following behaviour to me.  Using the
S2 taglibs and OGNL is starting to confuse me somewhat.  I have a test
JSP that I am accessing via the default ActionSupport class:

<[EMAIL PROTECTED] uri="http://java.sun.com/jstl/core"; prefix="c"%>
<[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>














 If I call my page via  "test.action?input=1".  I get:

   1. true
   2. true
   3. false
   4. true

   5. false
   6. false
   7. false
   8. false

Why is result 3 false?  If I then call my page via
"test.action?input=a".  I get:

   1. false
   2. false
   3.
   4. false

   5. true
   6. true
   7.
   8. true

Why are the result of 3 and 7 results now blank?  I have no idea what
is going on here, is this a bug?

It seems to only happen when I'm evaluating against a single
character.  I'm guessing it is some kind of char to String comparison
problem.  It would feel very odd if I had to start using single quotes
around my taglib attributes (I usually need double quotes for
XML/XHTML attributes).

Thanks,

Mark

-- 
"Paradoxically, the more time saving abstractions you are using the
more you actually have to know." - Simon Willison

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



Re: [S2] Wicket integration

2007-09-19 Thread Ted Husted
Sounds like a job for a plug-in!

A good starting point for developing a Wicket plugin might be the JSF plugin.

HTH, Ted


On 9/17/07, Chris Pratt <[EMAIL PROTECTED]> wrote:
> I'm wondering if anyone has been able to replace the Struts 2 view
> using Wicket.  It seems like a marriage made in heaven, since the
> whole philosophy behind Wicket is to stick to what they do well (the
> view) and delegate the rest to other projects that do other things
> well (Hibernate, Struts???)  Thoughts?
>   (*Chris*)

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



Re: [S2 and Ajax] Could not locale widget implementation...

2007-09-19 Thread Paolo Beccari
Follow up, just in case...

The two problems where related one each other. In fact:

Taglib 
<%@ taglib prefix="s" uri="/struts-tags" %>

was defined in the "main" page.

Inside the jsp called via Ajax by action result (inside s:div) I used tags
like s:property.

I discovered that when doing


the page called by the action result has to define another taglib prefix:
<%@ taglib prefix="another" uri="/struts-tags" %>

This way all things works fine:


gives the expected result.

P.

- Original Message 
Da: Struts Users Mailing List 
To: user@struts.apache.org 
Oggetto: Re: [S2 and Ajax] Could not locale widget implementation...
Data: 19/09/07 11:12

> 
> 
> 
> 
> Ops, I missed some information.
> In addition, when setting the s:head debug="true" I'm getting the message:
> 
> DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not
> locate widget implementation for "div" in "s.widget" registered to
namespace
> "s". Developers must specify correct namespaces for all non-Dojo widgets
--
> will be removed in version: 0.5
> DEBUG: dojo.widget.Parse: error:Error: Could not locate widget
> implementation for "div" in "s.widget" registered to namespace "s"
> 
> > 
> > 
> > 
> > 
> > Hi list,
> > 
> > I'm trying to display the results of a Form in a s:div through Ajax.
> > The submit is done fine, I can get the parameters through scriptlets
> > (request.getParameter...) but i can't use s2 tags (i.e.  > value="%{property}"/>): it seems they are not being rendered.
> > 
> > Could someone tell me where I'm wrong?
> > 
> > 
> > 
> 
> 
> 
> -
> 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]



[S2] action mappings help

2007-09-19 Thread Eugen Stoianovici
I'm trying to create an index with an action mapped to it for a 
subfolder in my webapp. The ideea was to create a index.jsp file that has:



so it redirects me to a mapped action. The problem is that even though 
the url is correct, i get a
"The requested resource (/myapp/subfolder/welcome.action) is not 
available" from my server.


If i point my browser to http://website/myapp/subfolder/welcome.action 
(ie: if i type this in) everything works out just fine. What am i doing 
wrong?


Thanks
Eugen Stoianovici

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



Re: Displaying table contents

2007-09-19 Thread Hiroyuki Suzuki

there are some mistakes in the siteTemplateSequence.

WRONG:   
siteName  siteSeqsiteTemplate  siteTemplateSequence
X  1 A,B,C   1
Y  2 D,E,F   2
Z  3 G,H,I3

CORRECT:
siteName  siteSeqsiteTemplate  
X  1 A,B,C 
Y  2 D,E,F 
Z  3 G,H,I 

siteTemplate   siteTemplateSequence
A  1
B  2
C  3
.. .. 
.. ..
I  9

-- 
View this message in context: 
http://www.nabble.com/Displaying-table-contents-tf4480149.html#a12774960
Sent from the Struts - User mailing list archive at Nabble.com.


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



Displaying table contents

2007-09-19 Thread Hiroyuki Suzuki

Hello guys..
Please help me in displaying the contents of the table.
I have the following in my database:
3 radio buttons (siteName/siteSequence)
each siteSequence has the following select options 
(siteTemplate/siteTemplateSequence)
Example:

siteName  siteSeqsiteTemplate  siteTemplateSequence
X  1 A,B,C   1
Y  2 D,E,F   2
Z  3 G,H,I3

For every siteList(radio button), it will display the corresponding
siteTemplate

Now I have this code in my JSP

 
   
  
 
   
 
 
   ${template.siteTemplate}
 

   
   


In the above code, the 3 buttons are displayed and each has their select
options, but the contents of each options
does not corresponds to each siteSequence, instead it displays all the
siteTemplate for each select options
(A,B,C,D,E,F,G,H,I)..

How will I connect the siteSequence to the siteTemplate so that it will
display only the corresponding siteTemplate for
each siteName?

Please help me..

Hiro
-- 
View this message in context: 
http://www.nabble.com/Displaying-table-contents-tf4480149.html#a12774871
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 and Ajax] Could not locale widget implementation...

2007-09-19 Thread Paolo Beccari

Ops, I missed some information.
In addition, when setting the s:head debug="true" I'm getting the message:

DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not
locate widget implementation for "div" in "s.widget" registered to namespace
"s". Developers must specify correct namespaces for all non-Dojo widgets --
will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:Error: Could not locate widget
implementation for "div" in "s.widget" registered to namespace "s"

> 
> 
> 
> 
> Hi list,
> 
> I'm trying to display the results of a Form in a s:div through Ajax.
> The submit is done fine, I can get the parameters through scriptlets
> (request.getParameter...) but i can't use s2 tags (i.e.  value="%{property}"/>): it seems they are not being rendered.
> 
> Could someone tell me where I'm wrong?
> 
> 
> 



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



[S2 and Ajax] Could not locale widget implementation...

2007-09-19 Thread Paolo Beccari
Hi list,

I'm trying to display the results of a Form in a s:div through Ajax.
The submit is done fine, I can get the parameters through scriptlets
(request.getParameter...) but i can't use s2 tags (i.e. ): it seems they are not being rendered.

Could someone tell me where I'm wrong?



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



Re: Struts138 - Restrict Access to my actions?

2007-09-19 Thread Paul Benedict
Thomas,

But you're using Struts 1.3.8 right? The interceptor solution is for Struts
2.

I once thought of adding an "internal" attribute to my Struts actions. If
the action had this property set through , then the Controller
would not allow the action to be executed directly (i.e., through the
address bar). The only way it could be accessed was if the action was
internally forwarded or included from a request.

Does this sound similar to you?

Paul


Re: struts 1.3.5 problem

2007-09-19 Thread Paul Benedict
"An existing connection was forcibly closed by the remote host" sounds like
some networking issue to me. It appears the server hung up the call.

Paul