Re: request.setAttribute

2003-11-28 Thread José Ventura
Is this a typo?

> if (s == null) System.out.println(s.getWmId());
> else System.out.println("null");

This will print null if the object is NOT null...

- Original Message -
From: "Paul McCulloch" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, November 28, 2003 10:38 AM
Subject: RE: request.setAttribute


> I'd concentrate on the bit of code in your action:
>
> > request.setAttribute("serverBean", new Server());
> > Server s = (Server)request.getAttribute("serverBean");
> > if (s == null) System.out.println(s.getWmId());
> > else System.out.println("null");
>
> If this returns null then nothing else is going to work. Try using
different
> classes instead of Server - I'd start with String.
>
> Paul
>
> > -Original Message-
> > From: Honza Spurný [mailto:[EMAIL PROTECTED]
> > Sent: 28 November 2003 12:33
> > To: Struts Users Mailing List
> > Subject: Re: request.setAttribute
> >
> >
> > Paul McCulloch wrote:
> > > The request attributes are all in a standard HashMap so I very much
> > > doubt there is any intrinsic size limit.
> > >
> > > What shows in your page if you paste in the fragment of jsp I put in
> > > one of my messages?
> > >
> >
> > ...
> > serverBean : cz.master.is.tech.server.Server
> > [EMAIL PROTECTED]
> > ...
> >
> >
> > > Are you sure that you aren't doing a redirect to the jsp?
> >
> > I don't understand well how do you mean it...
> >
> > the fragmnet of struts-config is:
> >
> >  > type="cz.master.is.tech.server.CreateServerAction"
> > input="/server/showServers.do">
> >
> >   
> >
> > the CreateServerAction i've attached last message.
> >
> > the editServer.jsp uses:
> >   > scope="request" />
> >
> > Very strange is, that when I try to do in the Action-class this:
> >
> > request.setAttribute("serverBean", new Server());
> > Server s = (Server)request.getAttribute("serverBean");
> > if (s == null) System.out.println(s.getWmId());
> > else System.out.println("null");
> >
> > NULL always appears... :(
> >
> > >
> > > Paul
> > >
> > >> -Original Message-
> > >> From: Honza Spurný [mailto:[EMAIL PROTECTED]
> > >> Sent: 28 November 2003 12:22
> > >> To: Struts Users Mailing List
> > >> Subject: Re: request.setAttribute
> > >>
> > >>
> > >> Paul McCulloch wrote:
> > >>> Please send some real code. I think you may have over simplfified
> > >>> what you are showing us.
> > >>>
> > >>> Paul
> > >>
> > >> No no, this is realy all :)
> > >>
> > >> look:
> > >>
> > >> public final class CreateServerAction extends Action
> > >> {
> > >>  public ActionForward execute(ActionMapping mapping,
> > ActionForm form,
> > >> HttpServletRequest request, HttpServletResponse response)
> > >>  {
> > >>   request.setAttribute("serverBean", new Server());
> > >>   return(mapping.findForward("success"));
> > >>  }
> > >>
> > >> }
> > >>
> > >>
> > >> in apropriate jsp page is used:
> > >>  > class="cz.master.is.tech.server.Server"
> > >> scope="request" />
> > >>
> > >> but by my opinion the problem is in the Server class, since
> > >> it has about 125
> > >> attributes (each attribute has setter and getter method), so
> > >> this object is
> > >> realy huge...
> > >>
> > >>>
> >  -Original Message-
> >  From: Honza Spurný [mailto:[EMAIL PROTECTED]
> >  Sent: 28 November 2003 12:09
> >  To: Struts Users Mailing List
> >  Subject: Re: request.setAttribute
> > 
> > 
> >  Paul McCulloch wrote:
> > > Have something print out all of the request scope
> > >> attributes and see
> > > what's there. I've attached a bit of jsp which I use to
> >  diagnose this
> > > sort of issue. Alternatively set a breakpoint in your code after
> > > setting the attribute and have a look in the debugger.
> > >
> > > 
> > > <%
> > > java.util.Enumeration e2 =
> > > this_request.getAttributeNames();
> > > while (e2.hasMoreElements()) {
> > > String element =
> > > (String)e2.nextElement();
> > > out.write("" + element + " : " +
> > > this_request.getAttribute(element).getClass().getName());
> > > out.write("" +
> > > this_request.getAttribute(element).toString() + "");
> > >
> > > }
> > >
> > >
> > > %>
> > 
> > 
> >  The MyObject is there, but always I want it download from
> >  request, I get
> >  null object.
> > 
> >  Why?
> > 
> > >
> > >
> > > Paul
> > >> -Original Message-
> > >> From: Honza Spurný [mailto:[EMAIL PROTECTED]
> > >> Sent: 28 November 2003 11:59
> > >> To: Struts Users Mailing List
> > >> Subject: Re: request.setAttribute
> > >>
> > >>
> > >> Paul McCulloch wrote:
> > >>> It still isn't correct. You staore it as "myObejct"
> > and try and
> > >>> retrieve it
> > >>> as "myObject"
> > >>
> > >> OK OK, that is only overwrite, sorry... but this is not
> > 

Re: [POLL] ActionFrom vs DynaActionForm

2003-09-30 Thread José Ventura
+1 (#1)

IMHO, especially because of IDE auto-completion (wich works with normal
ActionForms but not with Dynas). It really helps me when I don't remember
the exact spelling of a displayed field -- or when I don't remember WHAT
is displayed on screen :P

The time to generate new getters and setters doesn't really bother me...

[]'s
- ventura

- Original Message -
From: "Michael Ruppin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 30, 2003 2:33 PM
Subject: Re: [POLL] ActionFrom vs DynaActionForm


> +1 (#1).
>
> m
>
> --- Brandon Goodin <[EMAIL PROTECTED]> wrote:
> > #1
> >
> > Reasons:
> > -Dynas massive struts configs are annoying and the runtime errors
> > bite.
> > -DynaForm time saving is insignificant (how long does it take for your
> > ide to generate getters/setters?).
> > -Refactoring is easier is traditional ActionForms
> > -Also, for all the time that you spend restarting your tomcat for each
> > change you make to the config you could make changes to a hard class
> > more easily and let the classloader reaload it instead of the whole
> > container.
> > -An ActionForm is more cleanly organized in package structures (not
> > configs).
> > -DynaForms also have limitations in regards to the use of LazyList
> > -DynaForms also make extending more difficult
> > -DynaForms also don't have traditional getters and setter for the times
> > that you want to insert code into them (personally, I use them quite
> > often cuz I don't like huge Action classes)
> >
> > That said... I am not completely anti Dyna. I just don't see the value
> > in using them for everything. I've used them for my whole app and didn't
> > find them that useful. But, I have used them in niche cases where I
> > wanted to enhance chained action classes (see http://strutschaining.org/
> > ). But, even that can be solved with a mapped back form.
> >
> > IMAO - I do not see the case for DynaForms. But, I am willing to be
> > convinced.
> >
> > Brandon Goodin
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: Accessing an ID property of a bean using EL

2003-07-25 Thread José Ventura
Then again, I was having the same problem under Websphere 4.0.4, using
precisely this sintax:

public String getId();
public void setId( String s );

I was using just an ordinary 
and it just wouln't find the property no matter how nicely I asked it :)
I had to change it to "themeId" to get it to work.

I had assumed then it had something to do with IBM's VM's
reflection mechanism... but that's just speculating :)

[]'s
- ventura

- Original Message -
From: "Jim Collins" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 5:16 PM
Subject: Re: Accessing an ID property of a bean using EL


> Thanks Adam. I must have missed that variation of capitalisation.
>
> Regards
>
> Jim.
> - Original Message -
> From: "Adam Levine" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 23, 2003 8:32 PM
> Subject: Re: Accessing an ID property of a bean using EL
>
>
> > It has to deal with the way Java resolves bean fields where there are
> > multiple uppercase in a row.  I believe if you used .ID in your jsp it
> > should work.   I always get confused on how the rules work in resolving,
> so
> > I attempt to use as few caps in a row as possible.. ie, ID -> id ->
> > getId/setId -> myClass.id
> >
> >
> > From: "Jim Collins" <[EMAIL PROTECTED]>
> > Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Subject: Accessing an ID property of a bean using EL
> > Date: Wed, 23 Jul 2003 20:23:17 +0100
> >
> > Hi,
> >
> > I have a bean with the following methods:
> >
> > public String getID();
> > public void setID(String id);
> >
> > I am trying to access the id property in a page like this:
> >
> > ...
> >
> > Where folderDets is my bean. I have tried different combinations of ID
> > capitalisation but none seem to work. If however I change the property
to
> :
> >
> > public String getDocID();
> > public void setDocID(String id);
> >
> > And access it like this:
> >
> > ...
> >
> > It now works fine.
> >
> > Does anyone know why I can't have an ID property?
> >
> > Thanks
> >
> > Jim.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > _
> > The new MSN 8: smart spam protection and 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > -
> > 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: [Friday] How do you describe the greatest general?

2003-07-18 Thread José Ventura
I suppose he defeats every opponent in his own field...

But that's not a suitable answer for a [Friday] post, is it?
Anyone got any funnier ideas? :)

Maybe a politician converts every opponent in an ally?

[]'s
- ventura

- Original Message - 
From: "Jeff Kyser" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 4:41 PM
Subject: Re: [Friday] How do you describe the greatest general?


> blind fornicating deer
> 
> On Friday, July 18, 2003, at 02:31  PM, Jing Zhou wrote:
> 
> > He defeats every opponent in enemy's camp.
> >
> > How do you describe the greatest politician?
> >
> >
> >
> > Jing
> 
> 
> -
> 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] (SOLVED) Redirecting forwards under WAS 4.0.4

2003-07-18 Thread José Ventura
Sorry for the delay -- it worked!

Thanks, Susan! You're a life-saver!

And here I was almost making a workaround by duplicating every single
mapping in my struts-config (I'd remove them someday. No, really, I
would. I just needed to get it working for the time being ;)

[]'s
- ventura

- Original Message -
From: "Susan Bradeen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 17, 2003 3:25 PM
Subject: Re: [OT] Redirecting forwards under WAS 4.0.4


> On 07/16/2003 08:37:00 PM José Ventura wrote:
>
> > I'm back with my usual bizarre and weird grotesqueries under Websphere
> > 4.0. I've even marked this one off-topic to annoy less people!
> >
> > When I use a forward from within an Action, via the following snippet,
> > it works:
> >
> > fwd = "/editQuestionnaire.do?qId=" + qId;
> > return new ActionForward( fwd );
> >
> > If I use a redirecting forward instead, my app bites the dust:
> >
> > fwd = "/editQuestionnaire.do?qId=" + qId;
> > return new ActionForward( fwd, true ); // redirect == true
> >
> > In the first case, Struts finds my action mapping (/editQuestionnaire)
> > and everything works fine. In the redirecting forward, Struts complains
> > it can't find a mapping for "/inquirer/editQuestionnaire". This is
> > evident -- there is a mapping for "/editQuestionnaire", with no trailing
> > "/inquirer", wich is the context-root for my app.
> >
> > Somehow, Struts is receiving the full URL for the redirect, instead
> > of only the "/edit" part.
> >
> > As you may have guessed, it works fine on Tomcat.
> >
> > I will ask if anyone has seen this before, but since I suspect I'm
> > making a huge yet subtle mistake somewhere (Websphere can't be THAT
> > idiot, now can it?), I won't expect much.
>
> LOL! Nope, its not you. This behavior has been witness by a few people on
> this list including myself. My app has to support WAS 4.0.3. You can
> search the archives for Websphere and you should dig up some posts related
> to this. Since you are running 4.0.4 you should already have the fix pack
> that supposedly corrected this, but you also need to set a system property
> to make WAS redirect properly. I think the system property is
>
> com.ibm.webshpere.sendredirect.compliance=true
>
> Hope this helps,
>
> Susan Bradeen
>
> >
> > []'s
> > - ventura
>
> -
> 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]



[OT] Redirecting forwards under WAS 4.0.4

2003-07-16 Thread José Ventura
I'm back with my usual bizarre and weird grotesqueries under Websphere
4.0. I've even marked this one off-topic to annoy less people!

When I use a forward from within an Action, via the following snippet,
it works:

fwd = "/editQuestionnaire.do?qId=" + qId;
return new ActionForward( fwd );

If I use a redirecting forward instead, my app bites the dust:

fwd = "/editQuestionnaire.do?qId=" + qId;
return new ActionForward( fwd, true ); // redirect == true

In the first case, Struts finds my action mapping (/editQuestionnaire)
and everything works fine. In the redirecting forward, Struts complains
it can't find a mapping for "/inquirer/editQuestionnaire". This is
evident -- there is a mapping for "/editQuestionnaire", with no trailing
"/inquirer", wich is the context-root for my app.

Somehow, Struts is receiving the full URL for the redirect, instead
of only the "/edit" part.

As you may have guessed, it works fine on Tomcat.

I will ask if anyone has seen this before, but since I suspect I'm
making a huge yet subtle mistake somewhere (Websphere can't be THAT 
idiot, now can it?), I won't expect much.

[]'s
- ventura


Properties named "id" under WAS 4.0.1

2003-07-09 Thread José Ventura
Hi,

Has anyone had any issues with properties named "id" under Websphere 4.0.1?

I have a JSP page wich outputs some data from a bean. That bean has
getId(), setId(), getTitle() and setTitle(), among others, all expecting
and returning Strings. I write these out using the following:

 - 


When the generated servlet reaches the "id" one, it dies complaining
that it didn't find a getter for property id (stack trace at bottom).
Everything works fine if I comment that tag. 

I even tried replicating that field using another method:
public String getIde() { returns getId(); }


and it works!

And, as luck would have it, the same war works perfectly under Tomcat.

Is this a bug in the reflection mechanism of IBM's virtual machine? Or 
are "id" properties discouraged? Anyone has any ideas?

TIA

[]'s
- ventura

[03.07.09 16:02:26:043 GMT-03:00] 397616da WebGroup  X Servlet Error: No getter 
method for property id of bean theme: javax.servlet.jsp.JspException: No getter method 
for property id of bean theme
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:517)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:179)
at jsp.mai_00025taintheme.themes_jsp_1._jspService(themes_jsp_1.java:395)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:286)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at 
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at 
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at 
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at 
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at 
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at 
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at 
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1759)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at 
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at 
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at 
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at 
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at 
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at 
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at 
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at 
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at 
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at 
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at 
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
at 
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at 
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHan

Re: Submiting a form through a link

2003-06-29 Thread José Ventura
Have you gotten any JS errors when you clicked on it? I believe you
don't need the "javascript:" part when it's inside an eventhandler
(onXXX), only when it's inside an href.

Try [ ok ], see if it
works...

HTH

[]'s
- ventura

- Original Message -
From: "Cristiano Moreira Silva" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 5:12 PM
Subject: Re: Submiting a form through a link


> It's just something like this:
>
> function go()
> document.forms[0].submit();
> }
>
> 
> 
> 
> 
> 
> 
> 
>
>[ ok
> ]
> 
>
> What's wrong with this implementation. It happens
> nothing when I click in
> the "[ ok ]" link.
> But I'll try your tip. Thanks.
>
> - Original Message -
> From: "Steve Raeburn" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Sunday, June 29, 2003 2:20 PM
> Subject: RE: Submiting a form through a link
>
>
> > You don't need to use  because the link
> doesn't actually link
> to
> > anything, it just triggers the form submission. The
> path to your action is
> > actually in the  tag. The parameters that
> would normally be
> added
> > to the URL are specified in the hidden fields.
> >
> > If that's still not clear it would help if you
> posted some of your code so
> I
> > can better understand what you are trying to do.
> >
> > Steve
> >
> >
> >
> > > -Original Message-
> > > From: Cristiano Moreira Silva
> [mailto:[EMAIL PROTECTED]
> > > Sent: June 29, 2003 9:14 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Submiting a form through a link
> > >
> > >
> > > First of all, thanks for helping me, but I've one
> > > doubt: in the example
> > > below (the one you sent me), you aren't using
> > >  but 
> > > instead.  Where I put my link reference? Thanks
> again.
> > >
> > >  
> > >   value="MyAction"/>
> > >  
> > >
> > > - Original Message -
> > > From: "Steve Raeburn" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > Sent: Saturday, June 28, 2003 6:17 PM
> > > Subject: RE: Submiting a form through a link
> > >
> > >
> > > >> > onclick="document.forms[0].submit();return
> > > false;">Click
> > > > here
> > > >   (or the equivalent using Struts 
> tag.)
> > > >
> > > >   
> > > >  > > value="MyAction"/>
> > > >   
> > > >
> > > > The above code works for me. Not sure if the
> return
> > > false; has any
> > > impact -
> > > > probably does nothing.
> > > > Do you have more than one form on the page? You
> > > might need to change the
> > > > forms[] index number.
> > > > You can also try using the form name (which is
> the
> > > same as defined in
> > > > struts-config.xml) e.g.
> > > >
> > > >   document.forms['testForm'].submit()
> > > >
> > > > If that doesn't work then please post more of
> your
> > > form & link code.
> > > >
> > > > Steve
> > > >
> > > > p.s. Don't forget that if your users don't have
> > > javascript enabled then
> > > they
> > > > won't be able to use this feature of your site.
> ;-)
> > > >
> > > > > -Original Message-
> > > > > From: Cristiano Moreira Silva
> > > [mailto:[EMAIL PROTECTED]
> > > > > Sent: June 28, 2003 12:02 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Submiting a form through a link
> > > > >
> > > > >
> > > > > Hello. I'm trying to submit a html:form
> through a
> > > > > html:link. When I click the link, on the
> onclick
> > > > > event, I call a javascript function and
> execute:
> > > > >
> > > > > document.forms[0].submit()
> > > > >
> > > > > Then nothing happens.
> > > > >
> > > > > Can someone send me a simple example (or a URL
> to
> > > it)
> > > > > of submiting a html:form through html:link?
> > > Thanks.
> > > > >
> > > > >
> > > > >
> > > > > =
> > > > >
> > >
> 
> > > > > Cristiano Moreira Silva
> > > > > Site - http://computologo.vila.bol.com.br
> > > > > E-mail - [EMAIL PROTECTED]
> > > > > "Tudo posso nAquele que me fortalece." Fp.
> 4:13
> > > > >
> > > > >
> > >
> ___
> > > > > Yahoo! Mail
> > > > > Mais espaço, mais segurança e gratuito: caixa
> > > postal de 6MB,
> > > > > antivírus, proteção contra spam.
> > > > > http://br.mail.yahoo.com/
> > > > >
> > > > >
> > >
> -
> > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> -
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > =
> > >
> 
> > > Cristiano Moreira Silva
> > > Site - http://computologo.vila.bol.com.br
> >

Re: Display key itself when not found in MessageResources

2003-06-17 Thread José Ventura
Thanks a lot for all the replies!

Unfortunately, all the solutions appear to work only on
Struts 1.1. I'll not start the discussion again, but I can't
use 1.1 just yet, even though I want to ;)

Oh well. I'll try extending the Struts bean:message tag.

BTW, in JSTL the behavior is the same as when you set
, right? It'll display the
key between ???:

???foo???

Is there any way in JSTL to get rid of the ??? ?


In case you are interested, this app allows an user to create
some stuff on the database. One of the fields is the message
resource key identifying the record (yes, the user has to know
about resource bundles and all -- it's a technical back-office
app). But he may decide that no i18n is required for his record
and just put the name of the record in place of the key. That's
why I wanted the tag to display the message resource, if found,
or the key itself otherwise.


[]'s
- ventura

- Original Message -
From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 11:15 AM
Subject: RE: Display key itself when not found in MessageResources


> You could check if this key is there using logic:messagesPresent or
> logic:messagesNotPresent and then
> either use bean:message with that key or bean:write with some text
>
> > -Original Message-
> > From: José Ventura [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, June 17, 2003 4:03 PM
> > To: struts-users
> > Subject: Display key itself when not found in MessageResources
> >
> >
> > Been searching the archives, but with little luck. I even found a
> > thread about this
> > (http://www.mail-archive.com/[EMAIL PROTECTED]/msg687
> > 79.html),
> > but it didn't have an answer, so I'm reposting.
> >
> > If I use  and "foo" is not present
> > in my application resources file, the tag throws an exception
> > (stack trace at the end). I wanted it to display "foo" itself.
> >
> > Can I create a class that extends PropertyResourceBundle (or
> > whatever) that does not throw a MissingResourceException, and
> > specify it in my web.xml file like this?
> >
> > ...
> > application
> > com.foo.MySuperDuperResourceBundle
> > ...
> >
> > Unfortunately, I'm stuck with Struts 1.0.2 for the time being :(
> >
> > []'s
> > - ventura
> >
> > P.S. Here's the exception stack trace if anyone cares.
> >
> > javax.servlet.jsp.JspException: Missing message for key Minhas
Atividades
> >  at
> > org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242)
> >  at org.apache.jsp.menu$jsp._jspService(menu$jsp.java:1192)
> >  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > (Does anyone really cares about the rest :))) ?
> >
> >
> > -
> > 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]



Display key itself when not found in MessageResources

2003-06-17 Thread José Ventura
Been searching the archives, but with little luck. I even found a
thread about this
(http://www.mail-archive.com/[EMAIL PROTECTED]/msg68779.html),
but it didn't have an answer, so I'm reposting.

If I use  and "foo" is not present
in my application resources file, the tag throws an exception
(stack trace at the end). I wanted it to display "foo" itself.

Can I create a class that extends PropertyResourceBundle (or
whatever) that does not throw a MissingResourceException, and
specify it in my web.xml file like this?

...
application
com.foo.MySuperDuperResourceBundle
...

Unfortunately, I'm stuck with Struts 1.0.2 for the time being :(

[]'s
- ventura

P.S. Here's the exception stack trace if anyone cares.

javax.servlet.jsp.JspException: Missing message for key Minhas Atividades
 at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242)
 at org.apache.jsp.menu$jsp._jspService(menu$jsp.java:1192)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
(Does anyone really cares about the rest :))) ?


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



Re: Subclassing ActionMapping

2003-06-09 Thread José Ventura
I'm just guessing here, but have you tried using the
first signature (using the "normal" ActionMapping) and
then casting it inside your action to "myActionMapping"?

HTH
- v

- Original Message -
From: "Jerry Jalenak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 3:18 PM
Subject: Subclassing ActionMapping


> This should be so stinkin' obvious that I ought to be seeing it, but after
> spending all morning trying to figure this out, I hope someone can shed
some
> light for me.  I've subclassed ActionMapping so I can include a couple of
>  tags in my Actions.  This seems to work OK as I can see the
> 'setters' being called when the web app initializes.  The question I have
is
> this - which class do I specify for my execute action?  Do I use the
> standard method signature of
>
> public ActionForward execute(ActionMapping am, ActionForm af,
> HttpServletRequest req, HttpServletResponse res)
>
> or do I use my subclass?
>
> public ActionForward execute(myActionMapping am, ActionForm af,
> HttpServletRequest req, HttpServletResponse res)
>
> I've tried both.  When I use the normal signature, I can't see my custom
> attributes.  If I specify my subclassed ActionMapping class
> (myActionMapping), nothing seems to work (i.e. can't forward to anything,
> action never actually gets invoked).  In my struts-config I specify my
> subclassed ActionMapping class using the className attribute on the

> tag.
>
> Arrgh.  This shouldn't be this tough, but I just can't see it.
>
>
> Jerry Jalenak
> Team Lead, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
>
> [EMAIL PROTECTED]
>
>
> This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[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]



Where to put logic for "create or update" stuff?

2003-06-02 Thread José Ventura
I have a use case in wich a user will be created if its ID is 
null, or updated otherwise. 

What would be the preferrable approach?

a) My business services layer provides both createUser() and 
updateUser(), and I determine wich one to call inside my 
Action (by testing user.getId() ), or:

b) My business services layer provides a saveUser() method 
wich will have the necessary logic inside. This way all my 
Action needs to do is build a User object and pass it to 
the service layer.

I like the second one better. However, I've read that Struts
actions can be considered part of the controller layer; the first
option above does treat the action as a "controller" (there's 
logic in it), whereas option b) considers it to be something more
presentation-bound (almost no logic, simply converts requests 
into objects). 

Are there any advantages/pitfalls to these strategies?

TIA
- ventura


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



Re: [OT] RE: test

2003-05-30 Thread José Ventura
Well that depends. Would that be an european or an african swallow?

- Original Message - 
From: "Mark Galbreath" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 4:30 PM
Subject: [OT] RE: test


> Okay.  What's maximum velocity of a swallow?
> 
> -Original Message-
> From: Mick Knutson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 29, 2003 2:04 PM
> 
> test
> 
> 
> 
> -
> 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]