RE: help! confused over forms and errors and oooh, other stuff :-)

2001-02-21 Thread Geddes, Mark (ANTS)

If I understand your problem correctly, then I don't think you have missed
anything. I would be interested to know how you would solve the problem in a
non-struts environment. Unless your item details object is in session scope,
then it will not survive across two requests, which is the root of the
problem.
I would persevere with your approach of putting the details object in the
form bean.
Have you tried using hidden form variables. E.g.

html:hidden property="item.name"/
html:hidden property="item.manufacturer"/
html:hidden property="item.price"/
html:hidden property="item.info"/

html:text property="insideLeg"/
etc..

This should preserve values across a validation failure. I don't know for
sure. If I get time today I'll have a shot.
Let us know.

Mark

-Original Message-
From: Ned Seagoon [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2001 23:06
To: [EMAIL PROTECTED]
Subject: Re: help! confused over forms and errors and oooh, other stuff
:-)



Can nobody give me a clue as to whether I've missed something here? I have
to do a 'show and tell' session on friday where we probably will be deciding
whether to use struts as the basis of future developments. If I'm going to
have to branch away from struts to handle these issues, so be it, but I'd
rather hope they were handled somewhere. Worst case scenario is that we
don't use struts at all.

Regards
Ned

- Original Message -
From: "Ned Seagoon" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 11:47 AM
Subject: help! confused over forms and errors and oooh, other stuff :-)


 Hi Guys,

 I wonder if you could help me out a little please? I am in the middle of
 developing a proof of concept app with struts. If this comes off the
company
 could migrate away from a proprietary framework to struts, which I am in
 favour of.

 I seem to have confused myself over an issue regarding validation and
forms.
 I’ll give a simplified workflow as an example.

 We have for all intents and purposes a generated product overview page
along
 these lines:

 *Wooden Throat Mallet59.95 buy
 *Leather Uncle Frightener12.60 buy
 *Vandal-Proof Toupee 99.99 buy

 Which is generated from struts tags. The buys are links to a pages which
 look something like ‘buyit.do?itemid=50’. The buyit.do action has
registered
 a form in request scope. During processing, it looks up the full details
of
 the itemid and places the resulting bean in request scope. It then creates
 the form object, populates it with some default information and sets this
in
 the request too before forwarding onto buypage.jsp

 This displays the details of the item, and contains a form for entering,
 say, credit card details:

 *Item: Vandal-Proof Toupee
 *Manufacturer: Lockheed-Martin Advanced Hairpiece Research
 *Price: 99.99
 *Additional Information: Also Invisible to Radar
 *
 * Inside Leg Measurement: _
 * Credit Card Number: 
 * BUY {forwards onto checkout.do}

 Which is all fine and dandy and displays correctly. Though what happens if
 the form validate fails? If checkout.do has an ‘input’ attribute which is
 buypage.jsp then this will fail because the item details are stored on the
 request has not been set up (it was done in ‘buyit.do’). I could of course
 set the item details on the session, but if the user opened new browser
 windows for the ‘buyit’ link, then the session level object will be
 overwritten.

 If have looked into placing the details object onto the form bean as it is
 populated, but will that property be preserved across a validate failing?
 And how do I get at the properties of the form bean outside of the
 hmtl:xxx tags?

 Help !

 Regards
 Ned



 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





***
This email message contains confidential information for the above addressee only.  If 
you are not the intended addressee you must not disclose or use the information in any 
manner whatsoever.

Any opinion or views contained in this email message are those of the sender, do not 
represent those of the Company in any way and reliance should not be placed upon its 
contents.

Unless otherwise stated this email message is not intended to be contractually 
binding.  Where an Agreement exists between our respective companies and there is 
conflict between the contents of this email message and the Agreement then the terms 
of that Agreement shall prevail.

Abbey National Treasury Services plc. Registered in England. Registered Office:  Abbey 
House, Baker Street, London NW1 6XL.  Company Registration No: 2338548.  Regulated by 
the SFA
***



Re: help! confused... now contains a proposal

2001-02-21 Thread Ned Seagoon

Hi Hal, thanks for your mail

Yep that would be one solution if the population if the bean required on the
form page was 'static', but in the case I was referring too it needed the
item id to look up. I would imagine that it might be done by sending
actionforms with the id in backwards and forwards but this would become a
maintenance nightmare.

I reckon the way to approach this is to modify ActionForm handling. I would
add a field to this which holds the HttpServletRequest which gets set when
the form is created/retrieved in ActionServlet.processActionForm. The
ActionForm should also have a method called something like populateForm()
which the user developer could override to retrieve any values required from
sessions/databases etc. This would be called automatically when
formValidation *fails* and is probably better left to the developer to call
from Action.performAction if validation succeeds. My example would then be
along the lines of:

ActionForm {
... other stuff...

HttpServletRequest request;
void setRequest(HttpServletRequest r) {.}
void populateForm() {}
}

MyOrderActionForm extends ActionForm {
String itemId;
Object item;

// get/set item id and get/set item omitted

void populateForm() {
ItemMap map= (ItemMap) request.getSession.getAttribute("item map");
item = map.get(itemId);
}
}

and for the buyit.do action (remember, called from /buyit.do?itemid=52)

perform(.) {

MyOrderActionForm form = new MyOrderActionForm();
form.setItemId( request.getParameter("itemid") );
form.populateForm();

request.setAttribute("orderform", form);

  return mapping
}

And on the view, the object bean could be got from the form for displaying.

Any thoughts?

It would be better to place this into the ActionForm class and do it
properly, but I'll wait until the feature freeze is over before trying to
submit it. In the mean time i'm going to have to derive my own classes and
override functions.

Regards
Ned

- Original Message -
From: "Deadman, Hal" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 11:28 PM
Subject: RE: help! confused over forms and errors and oooh, other stuff :- )


I don't know if I understand your question but would making the input
attribute of the action another action give you the opportunity to retrieve
data that the jsp form needs before the jsp is displayed? I have a form that
needs a drop down populated from the database before the form is displayed.
I can never go to the jsp form directly, I always reference the action that
gets the data needed by the jsp. The action returns a forward which forwards
to the jsp with redirect="false".

Hal





Re: help! confused over forms and errors and oooh, other stuff :-)

2001-02-21 Thread Ned Seagoon

Hi Maya,

Yep I believe that struts has a great future. I do believe that it is the
model we should be working with. I am just worried that because of the
current limitations that we will not use it. There are whole swathes of
stuff that needs to be done, especially when it comes to
internationalisation/formatting support when it comes to the view output,
but that is not a problem. Custom tags can be built to handle what is
required (as I have done so) but the internal workings of the actionServlet
is a different matter. If that does not support what you want then you end
up having to branch away from the codeline (which I don't want to do, it's a
maintenance nightmare).

We use log4J here. Now that log4j is under the apache wing, I take it that
tomcat and struts will start to use it at some point?

Regards
Ned


- Original Message -
From: "Maya Muchnik" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 11:23 PM
Subject: Re: help! confused over forms and errors and oooh, other stuff :-)


 Hi, Ned,

 I am only in the beginning of my project developing, as you are. Tell your
guys
 / managers that this project has a great future. Of course, it is not easy
from
 the first time.

 I am sorry, I do not know how resolve your problem, but try to insert a
package
 log4j from jakarta to print out all values / attributes to see where you
loose
 them.

 I wish you the best, as for us too. Please, do not panic.

 Maya

 Ned Seagoon wrote:

  Can nobody give me a clue as to whether I've missed something here? I
have
  to do a 'show and tell' session on friday where we probably will be
deciding
  whether to use struts as the basis of future developments. If I'm going
to
  have to branch away from struts to handle these issues, so be it, but
I'd
  rather hope they were handled somewhere. Worst case scenario is that we
  don't use struts at all.
 
  Regards
  Ned
 
  - Original Message -
  From: "Ned Seagoon" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, February 20, 2001 11:47 AM
  Subject: help! confused over forms and errors and oooh, other stuff :-)
 
   Hi Guys,
  
   I wonder if you could help me out a little please? I am in the middle
of
   developing a proof of concept app with struts. If this comes off the
  company
   could migrate away from a proprietary framework to struts, which I am
in
   favour of.
  
   I seem to have confused myself over an issue regarding validation and
  forms.
   I?ll give a simplified workflow as an example.
  
   We have for all intents and purposes a generated product overview page
  along
   these lines:
  
   *Wooden Throat Mallet59.95 buy
   *Leather Uncle Frightener12.60 buy
   *Vandal-Proof Toupee 99.99 buy
  
   Which is generated from struts tags. The buys are links to a pages
which
   look something like ?buyit.do?itemid=50?. The buyit.do action has
  registered
   a form in request scope. During processing, it looks up the full
details
  of
   the itemid and places the resulting bean in request scope. It then
creates
   the form object, populates it with some default information and sets
this
  in
   the request too before forwarding onto buypage.jsp
  
   This displays the details of the item, and contains a form for
entering,
   say, credit card details:
  
   *Item: Vandal-Proof Toupee
   *Manufacturer: Lockheed-Martin Advanced Hairpiece Research
   *Price: 99.99
   *Additional Information: Also Invisible to Radar
   *
   * Inside Leg Measurement: _
   * Credit Card Number: 
   * BUY {forwards onto checkout.do}
  
   Which is all fine and dandy and displays correctly. Though what
happens if
   the form validate fails? If checkout.do has an ?input? attribute which
 is
   buypage.jsp then this will fail because the item details are stored on
the
   request has not been set up (it was done in ?buyit.do?). I could of
course
   set the item details on the session, but if the user opened new
browser
   windows for the ?buyit? link, then the session level object will be
   overwritten.
  
   If have looked into placing the details object onto the form bean as
it is
   populated, but will that property be preserved across a validate
failing?
   And how do I get at the properties of the form bean outside of the
   hmtl:xxx tags?
  
   Help !
  
   Regards
   Ned
  
  
  
  
_
   Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
  
  





RE: help! confused over forms and errors and oooh, other stuff :- )

2001-02-21 Thread Ned Seagoon


Hi Mark, thanks for the reply

If I understand your problem correctly, then I don't think you have missed
anything. I would be interested to know how you would solve the problem in 
a
non-struts environment. Unless your item details object is in session 
scope,
then it will not survive across two requests, which is the root of the
problem.

Yeah, the other problem being is that if the details object is in the 
session and the user has two windows open, then all hell will break loose!

I would persevere with your approach of putting the details object in the
form bean.
Have you tried using hidden form variables. E.g.

 html:hidden property="item.name"/
 html:hidden property="item.manufacturer"/
 html:hidden property="item.price"/
 html:hidden property="item.info"/

Yeah, I didn't think of doing that. The only problem with that is of 
maintenance. If I add another field to the details object, then every form 
has to change. It's bad enough with forms as it is, I'm thinking about 
modifing the form tag to auto generate hidden fields for any properties of a 
form not accessed explicitally.

Cheers
Ned
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




RE: Display Table using Iterate Tag

2001-02-21 Thread Dorai, Harish (c)

Thanks for your help. I used the struts-example application to display the
table.

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 6:14 PM
To: [EMAIL PROTECTED]
Subject: Re: Display Table using Iterate Tag


Install struts-example.war file and try it. You will see how this example
use
struts to display multiple rows.

"Dorai, Harish (c)" wrote:

 Hello all,

 I am new to the JSP and Struts framework.

 How can I use the Iterate tag to display a few rows of the Database table?
I
 am storing the rows as a vector of vectors. Has anyone tried using Iterate
 tag for similar stuff?

 Thanks,
 Harish.



RE: Template tags?

2001-02-21 Thread John Nikolai

At 08:27 PM 2/20/2001 -0500, you wrote:
  during this process. First off,  the web pages we will be creating will
  have a common navigation bar used across the whole web site. It would be
  great if we can create one HTML file called navigation.jsp which
  all pages use.

If that's the only common element on the pages, you can do that
using the JSP include tags, pulling in the common nav bar within
each content page.

The template tags (as we've been using them, at least) support a
somewhat different model: your content pages push their specific
content into common templates, which place the content into regions
of the template.  This allows you to have standard headers, footers,
or any other common content and layout without the content pages
needing to know or care what the standard layout is; it also allows
you to redesign the template, potentially completely re-ordering
the content presentation, without changing the content pages at all.

We've introduced the template tags to both java coders and HTML
authors, and all found it easy to understand and like,
and quite powerful.

This is what we used to do with our old custom tags. We would have one html 
file which contained the navigation portion (both a top and left hand 
navigation bar). We inserted a custom tag called "application" which would 
be "filled" in with a particular application when rendered. We wrote one 
class to render the navigation portion and created several abstract methods 
so that subclass can fill in the "application" and "menu" tags as needed. 
It looked like the following (please excuse the bad ascii art ;-)

  NavPageDisplayer
 ^
 | ProfilePageDisplayer
 | LoginPageDisplayer
 | MainPageDisplayer
 | etc...

So each NavPageDisplayer subclass would always be rendered with the 
navigation bar. With this design it was very easy to create a new dynamic 
page. I was hoping we could do something similar with the template taglib 
used by struts.


  It seems that the struts template taglibs might be the solution,
  unfortunately the 0.5 version of struts we downloaded does not contain
  these taglibs.

In my experience, cvs or nightly builds have been solid for
a long while, and have been quite safe for development, not
only for the template tags, but for the entire library.

Andy Boyko[EMAIL PROTECTED]


I will download the latest source from cvs. Thank you to everyone for your 
help!

  - John




RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

I am using the components add-on and I like it but it shouldn't go into the
1.0 release. It's too much code and has too much functionality to be merged
without some more review which will take time. One problem I have noticed is
that when a component is included the exceptions are caught which makes it
difficult to have any kind of global error handler. That's an easy fix but
merging the code will not be a trivial effort. 

Besides, there is no compelling reason to add it to struts now because there
is nothing to stop people using struts from also using the components
framework. When it is added to struts there will probably be some re-work
involved but it should be straightforward. 

Hal

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:48 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts, WebLogic 6.0 and template tags


Hello, Torsen,

It is not an answer to your question. But I would like to use this email and
ask the struts development team about compatibility template library and
components library (http://www.lifl.fr/~dumoulin/components/). Components
allow
to define "instances" to reuse them with different parameter values. They
have
good examples how to use them for implementation. They do not have a "role"
attribute yet. Both components and templates have a lot of common. Why not
combine the best parts both of them and put under struts project before 1.0
release?

"Beuck, Torsten" wrote:

 Hi, we like to use Struts with Bea WLS 6.0 for a B2B application.
Currently
 I am developing a prototype and the first tests under Tomcat worked fine.
I
 used the Struts template tags for a page design with header, navigation
menu
 and content. An example:

 %@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %

 template:insert template='/pageTemplate.jsp'
   template:put name='logo' content='/logo.jsp' /
   template:put name='header' content='/header.jsp' /
   template:put name='menu' content='/menu.jsp' /
   template:put name='content' content='/content.jsp'/
 /template:insert




multiple login

2001-02-21 Thread Maya Muchnik

Hi,

 In other mail list it was a lot of discussion about a user login /
logon through multiple web pages or different browser. They have
discussed how to prevent the multiple login. My question is this: does
struts provide an easy way (or some way) to handle this situation or
not?

Maya




Re: Dynamic properties

2001-02-21 Thread Craig R. McClanahan



Allan Schweitz wrote:

Can
anyone tell me if the forms struts supports dynamic properties? If so is
there an example available on how this works?I
have a html form that builds up dynamically creating a table with checkboxes,
text input and selectboxes. But since this form is dynamically generated
there is no form class that reflects the dynamically generated form and
struts cannot handle it.If
anyone knows how to solve this in struts please let me know.Thanks
in advance,Allan Schweitz[EMAIL PROTECTED]
Struts 1.0 does not support dynamic properties, but this is on the TODO
list for Stuts 1.1. Given the number of questions about it, I expect
it to be fairly high in the priorities.
Craig





Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Cedric Dumoulin


  When you have a lot of nested Components, and one is faulty, it is very hard
to discovered which one. It is why the actual implementation of insert catch the
exception, and show it in browser. We definitely need to find a better solution.

Cedric

"Deadman, Hal" wrote:

 I am not sure what you are looking for. The component library comes with
 examples including a struts-template example that uses the component
 library.

 The issue with components I was complaining about, albeit not clearly, was
 that if a jsp that is part of a component instance and the jsp throws an
 exception, the code surrounding the include will trap the exception and
 print it to the browser. I would prefer that the exception was not caught so
 that I could set up some global handler. Trapping the exception and printing
 it to the browser means that the site operator won't know users are
 experiencing trouble.

 Below is some of the offending code from
 s1.struts.taglib.component.IncludeTag.java. Fixing it would involve trapping
 the exceptions and throwing a JspException. Unfortunately that has its own
 problems because JspExceptions can't nest the root exception so you don't
 know exactly where the error occured. At least you know that something bad
 happened. I am not planning to fix this problem for the time being, I am
 just planning to write the jsps so they don't fail. :


 Hal

 ...
 pageContext.include(page);
 }
catch (IOException ex)
 {
 processException( ex, "Can't include page '"+ page+ "' : " +
 ex.getMessage() );
 }
catch (IllegalArgumentException ex)
 {
 // Can't resolve page uri
 processException( ex, "Tag 'include' can't include page '" + page +
 "'. Check if it exist.\n" + ex.getMessage() );
 }
catch (ServletException ex)
 {
 Throwable realEx = ex;
 if( ex.getRootCause() != null )
   {
   realEx = ex.getRootCause();
   }
 processException( realEx, "[ServletException in:"+ page+ "] " +
 realEx.getMessage()+ "'" );
 }
   catch (Exception ex) {
 processException( ex, "[Exception in:" + page + "] "+
 ex.getMessage());
 }

 -Original Message-
 From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 11:28 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Struts, WebLogic 6.0 and template tags

 Hal,
 Please give a code example with a component, when you cannot get an
 exception.
 And how it can be fix now.
 Maya

 "Deadman, Hal" wrote:

  I am using the components add-on and I like it but it shouldn't go into
 the
  1.0 release. It's too much code and has too much functionality to be
 merged
  without some more review which will take time. One problem I have noticed
 is
  that when a component is included the exceptions are caught which makes it
  difficult to have any kind of global error handler. That's an easy fix but
  merging the code will not be a trivial effort.
 
  Besides, there is no compelling reason to add it to struts now because
 there
  is nothing to stop people using struts from also using the components
  framework. When it is added to struts there will probably be some re-work
  involved but it should be straightforward.
 
  Hal
 




Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Beuck, Torsten

Hi, we like to use Struts with Bea WLS 6.0 for a B2B application. Currently
I am developing a prototype and the first tests under Tomcat worked fine. I
used the Struts template tags for a page design with header, navigation menu
and content. An example:

%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %

template:insert template='/pageTemplate.jsp'
  template:put name='logo' content='/logo.jsp' /
  template:put name='header' content='/header.jsp' /
  template:put name='menu' content='/menu.jsp' /
  template:put name='content' content='/content.jsp'/
/template:insert

Now, when I deploy the web application to WLS I get the following:

21.02.2001 13:21:12 GMT+01:00 Error HTTP
[WebAppServletContext(5574888,b2bweb)] Servlet failed with Exception
java.lang.NullPointerException
at org.apache.struts.taglib.template.PutTag.hasBody(PutTag.java:198)
at
org.apache.struts.taglib.template.PutTag.getContent(PutTag.java:181)
at
org.apache.struts.taglib.template.PutTag.doEndTag(PutTag.java:152)
at jsp_servlet._loginpage._jspService(_loginpage.java:111)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


I tried to debug the application an it seems as if the setBodyContent()
method of class PutTag is not invoked, so that the bodyContent member
variable is null. This leads to a NullPointerException in the method
hasBody().
Is that right? Is there a workaround? I like the template tags, so i don't
want to give them up.

By the way: Is the problem described in msg01892 (PropertyResource problem
on WebLogic 6.0) fixed?

Thanks, Torsten
---
Torsten Beuck
OTTO Versand
Abteilung IT-SP-WQ
Wandsbeker Str. 3 - 7
22172 Hamburg

Tel.: ++49 40 6461 5351
Fax: ++49 40 6464 5351
eMail: [EMAIL PROTECTED]



Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Maya Muchnik

Hal,
Please give a code example with a component, when you cannot get an exception.
And how it can be fix now.
Maya

"Deadman, Hal" wrote:

 I am using the components add-on and I like it but it shouldn't go into the
 1.0 release. It's too much code and has too much functionality to be merged
 without some more review which will take time. One problem I have noticed is
 that when a component is included the exceptions are caught which makes it
 difficult to have any kind of global error handler. That's an easy fix but
 merging the code will not be a trivial effort.

 Besides, there is no compelling reason to add it to struts now because there
 is nothing to stop people using struts from also using the components
 framework. When it is added to struts there will probably be some re-work
 involved but it should be straightforward.

 Hal





Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Craig R. McClanahan

Maya Muchnik wrote:

 Hello, Torsen,

 It is not an answer to your question. But I would like to use this email and
 ask the struts development team about compatibility template library and
 components library (http://www.lifl.fr/~dumoulin/components/). Components allow
 to define "instances" to reuse them with different parameter values. They have
 good examples how to use them for implementation. They do not have a "role"
 attribute yet. Both components and templates have a lot of common. Why not
 combine the best parts both of them and put under struts project before 1.0
 release?


There is no end to good ideas for improvements to Struts, and the components
library is one of them.  However, if we kept adding new functionality we'd never
have a 1.0 release, and that's not good either.

This is definitely high on my personal priority list to look at for 1.1.

Craig





RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

My hasBody() method is like the following so it shouldn't have a null
pointer exception. Are you using a recent nightly build? I think I had this
problem a couple months ago but I think it has been fixed for awhile. 

   private boolean hasBody() {
  if (bodyContent == null)
 return (false);
  return ! bodyContent.getString().equals("");
   }

-Original Message-
From: Beuck, Torsten [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:26 AM
To: '[EMAIL PROTECTED]'
Subject: Struts, WebLogic 6.0 and template tags


Hi, we like to use Struts with Bea WLS 6.0 for a B2B application. Currently
I am developing a prototype and the first tests under Tomcat worked fine. I
used the Struts template tags for a page design with header, navigation menu
and content. An example:

%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %

template:insert template='/pageTemplate.jsp'
  template:put name='logo' content='/logo.jsp' /
  template:put name='header' content='/header.jsp' /
  template:put name='menu' content='/menu.jsp' /
  template:put name='content' content='/content.jsp'/
/template:insert

Now, when I deploy the web application to WLS I get the following:

21.02.2001 13:21:12 GMT+01:00 Error HTTP
[WebAppServletContext(5574888,b2bweb)] Servlet failed with Exception
java.lang.NullPointerException
at org.apache.struts.taglib.template.PutTag.hasBody(PutTag.java:198)
at
org.apache.struts.taglib.template.PutTag.getContent(PutTag.java:181)
at
org.apache.struts.taglib.template.PutTag.doEndTag(PutTag.java:152)
at jsp_servlet._loginpage._jspService(_loginpage.java:111)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


I tried to debug the application an it seems as if the setBodyContent()
method of class PutTag is not invoked, so that the bodyContent member
variable is null. This leads to a NullPointerException in the method
hasBody().
Is that right? Is there a workaround? I like the template tags, so i don't
want to give them up.

By the way: Is the problem described in msg01892 (PropertyResource problem
on WebLogic 6.0) fixed?

Thanks, Torsten
---
Torsten Beuck
OTTO Versand
Abteilung IT-SP-WQ
Wandsbeker Str. 3 - 7
22172 Hamburg

Tel.: ++49 40 6461 5351
Fax: ++49 40 6464 5351
eMail: [EMAIL PROTECTED]



RE: submitting form containing an object with indexed property - BUG IN STRUTS???

2001-02-21 Thread Jason H. Kim

I don't think it's really about indexed property. I cahnged scope in
struts-config for this for to session, and it works fine. - but this is not
desirable cause i am using one form bean for multiple forms and maintaining
session bean will be a nightmare..

I understand struts creating a new formbean cause the one it got in the form
was in request scope, however, it should still be populated properly. - but
it's not..

Is it a bug in struts??

Thank you.

Jason H. Kim
Quatrix Emerging Technology Team
Phone: 314-993-5858 EXT: 137

-Original Message-
From: Jason H. Kim [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:54 AM
To: Struts-User Mail Group
Subject: submitting form containing an object with indexed property


I am trying to submit an ActionForm instance upon submission of a form. But
I think it's sending each properties as request parameter and not the whole
object. The object that subsequent Action receives is a newly constructed
(the one created by ActionForm form = new ActionForm()) one. Following is
the jasper.log:

JspEngine -- /TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001ServletPath:
/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001   PathInfo:
null/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001   RealPath:
/www/time-dev/webapps/time/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001 RequestURI:
/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001QueryString:
null/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001 Request Params: /JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001fridayHour[1] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001saturdayHour[2] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001wednesdayHour[0] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001sundayHour[2] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001fridayHour[4] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001thursdayHour[0] =
0.0/JASPER_LOG
...



The form "displayed" the object just fine, using index properties and such,
but failed to "submit" the object. I looked at my configuration file and my
jsp source and i can't find anything..


Following is my struts-config.xml:
  form-beans
form-bean
  name="com.qett.time.bean.timeformbean"
  type="com.qett.time.bean.TimeFormBean" /
  /form-beans
  action-mappings
actionpath="/hourinput"
   type="com.qett.time.servlet.HourInputAction"
   name="com.qett.time.bean.timeformbean"
  scope="request"
  input="TaskBasedTime.jsp"
   validate="true"
  forward name="success"path="/TaskBasedComment.jsp"/
/action
  /action-mappings

and following is my jsp page.. it gets the bean
com.qett.time.bean.timeformbean as a request parameter from previously
executed Action - The form is pre-populated.



html:form action="/hourinput.do"

table align="center" class="BoxWithHeader" width="700"
tr
td colspan="9" align="center"
table width="100%" cellpadding="0" cellspacing="0"

%
int i;
for (i = 0; itime.getArraySize(); i++) {
String styleClass = "ReportRowOdd";
if ((i % 2)==0) {
styleClass = "ReportRowEven";
}
String prop0 = "projectToTaskMap[" + i + "]";
String prop1 = "indexName["+i+"]";
String prop2 = "sundayHour["+i+"]";
String prop3 = "mondayHour["+i+"]";
String prop4 = "tuesdayHour["+i+"]";
String prop5 = "wednesdayHour["+i+"]";
String prop6 = "thursdayHour["+i+"]";
String prop7 = "fridayHour["+i+"]";
String prop8 = "saturdayHour["+i+"]";
String prop9 = "SPTotalTime["+i+"]";
%
!-- In the following write tags, name field should match that of the Bean
specified in struts-config.xml --
tr
td width="140" align="center" class=%= styleClass %bean:write
name="com.qett.time.bean.timeformbean" property="%= prop1 %" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop2 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop3 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop4 %" size="3"
maxlength="4" //td
td 

Re: Missing struts-config_1_0.dtd when not logged on

2001-02-21 Thread DONNIE HALE

Well I'm sure this should work under Tomcat 3.2.1 (unless something in the Feb 20 
build broke things). I've had this issue under other servlet engines, and a slight 
enhancement was made to Struts last week as a workaround. In the web.xml, add a 
parameter to the Action servlet with the name "validating" and the value "false"; and 
remove the !DOCTYPE ...  tag from the struts-config.xml file. This will prevent DTD 
validation from being done when the struts-config.xml file is being parse.

In the case of Tomcat 3.2.1, though, I'd only use this temporarily as a workaround. I 
know this has and is supposed to work on that platform.

-Donnie


 [EMAIL PROTECTED] 02/21/01 11:02AM 
Tomcat 3.2.1

DONNIE HALE wrote:

 What servlet engine are you using?

 -Donnie

  [EMAIL PROTECTED] 02/21/01 09:19AM 
 Presumeably some kind of configuration error. Any ideas how to correct
 this?

 I'm using the Feb 20 build. During startup when SAXParserImpl trys to
 execute for the struts-example, if I'm logged on to the Internet, I get:

 resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')

  Not registered, use system identifier

 If I am logged on, I get:

 resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')

  Not registered, use system identifier
 Parse Fatal Error at line 5 column -1: External entity not found:
 "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd".
 org.xml.sax.SAXParseException: External entity not found:
 "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd".
  java.lang.Throwable(java.lang.String)
  java.lang.Exception(java.lang.String)
  org.xml.sax.SAXException(java.lang.String, java.lang.Exception)
  org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator,
 java.lang.Exception)
  void com.sun.xml.parser.Parser.fatal(java.lang.String, java.lang.Object
 [], java.lang.Exception)
  void
 com.sun.xml.parser.Parser.externalParameterEntity(com.sun.xml.parser.ExternalEntity)

  boolean com.sun.xml.parser.Parser.maybeDoctypeDecl()
  void com.sun.xml.parser.Parser.parseInternal(org.xml.sax.InputSource)
  void com.sun.xml.parser.Parser.parse(org.xml.sax.InputSource)
  void javax.xml.parsers.SAXParser.parse(org.xml.sax.InputSource,
 org.xml.sax.HandlerBase)
  void javax.xml.parsers.SAXParser.parse(java.io.InputStream,
 org.xml.sax.HandlerBase)
  java.lang.Object
 org.apache.struts.digester.Digester.parse(java.io.InputStream)
  void org.apache.struts.action.ActionServlet.initMapping()
  void org.apache.struts.action.ActionServlet.init()
  void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
  void org.apache.tomcat.core.ServletWrapper.doInit()
  void org.apache.tomcat.core.Handler.init()
  void org.apache.tomcat.core.ServletWrapper.init()
  void
 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(org.apache.tomcat.core.Context)

  void
 org.apache.tomcat.core.ContextManager.initContext(org.apache.tomcat.core.Context)

  void org.apache.tomcat.core.ContextManager.init()
  void org.apache.tomcat.startup.Tomcat.execute(java.lang.String [])
  void org.apache.tomcat.startup.Tomcat.main(java.lang.String [])
  java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,
 java.lang.Object [])
  void TomcatStart.start(java.lang.String [], java.lang.String)
  void TomcatStart.main(java.lang.String [])

 --
 Tom Miller
 Miller Associates, Inc.
 [EMAIL PROTECTED] 
 641.469.3535 Phone
 413.581.6326 FAX

--
Tom Miller
Miller Associates, Inc.
[EMAIL PROTECTED] 
641.469.3535 Phone
413.581.6326 FAX






taglib error when running struts1.0 on weblogic 5.1

2001-02-21 Thread Nanduri, Amarnath

Hi all,

   I created a sample application of my own. I am getting a taglib error
when trying to access a jsp page ? Any suggestions will be appreciated. 

The steps i went though are..
. I created a jar file and re-named it as a war file . I followed the same
structure as the example application given with struts 1.0

. I was able to run the example application without any problem. The problem
comes when i try to run my application. Below is the exception i get... Any
help is very much appreciated. Thanks.


cheers,
Amar..



Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo resolving
taglib ur
i '/WEB-INF/struts-bean.tld' to taglib-location /WEB-INF/struts-bean.tld:
Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
taglib
uri /WEB-INF/struts-bean.tld as resource /WEB-INF/WEB-INF/struts-bean.tld in
Web
 Application root:
Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
taglib
uri /WEB-INF/struts-bean.tld as resource /WEB-INF/struts-bean.tld in Web
Applica
tion root:
java.io.IOException: cannot resolve '/WEB-INF/struts-bean.tld' into a valid
tag
library
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:94)
at
weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, C
ompiled Code)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java,
Compil
ed Code)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled
Code
)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1760)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1601)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
Code)

at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:164)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:101)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:907)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:851)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:364)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
Wed Feb 21 10:50:00 EST 2001:E WebAppServletContext-demo Root cause of
Servl
etException
weblogic.utils.ParsingException: nested IOException: java.io.IOException:
cannot
 resolve '/WEB-INF/struts-bean.tld' into a valid tag library
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:164)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:101)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:907)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:851)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:364)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)



Re: help! confused... now contains a proposal

2001-02-21 Thread Ned Seagoon


 Ned Seagoon wrote:
  I reckon the way to approach this is to modify ActionForm handling. I
would
  add a field to this which holds the HttpServletRequest which gets set
when
  the form is created/retrieved in ActionServlet.processActionForm.


From: "Craig R. McClanahan" [EMAIL PROTECTED]
 Are you planning on keeping this reference to the HttpServletRequest
object past
 the end of the current request?  If so, you are pretty much guaranteed to
have
 problems on any servlet container (such as Tomcat) that recycles request
and
 response objects.  The 2.3 servlet spec is also likely to clarify that
it's not
 legal to maintain references to the request and response objects after
your
 servlet's service() method returns.

D'oh! Oh yes, of course. I was thinking of keeping the request around so
that in a function like setItemId it could use the request to do a lookup
for any information and set it into the form bean. Fine, I'll just change
the populate() function to take the HttpServletRequest there.

This pattern works, I modified ActionServlet.ProcessValidate so that if the
validation fails, a class cast is attempted and populate() called on the
form. This then picks up the required object from the session (via the
request) and stores it in the form, ready to be displayed by the view.

So what do you think? Is this worthy of being incorporated? Maybe this
solution is not correct, but there is definately a need for what it is
fixing...

regards
Ned.



Re: struts 1.0 weblogic 5.10 sp8 jsp exception

2001-02-21 Thread Craig R. McClanahan

"Nanduri, Amarnath" wrote:

 Hi,

  I am getting this error at the html:html locale="true" tag. Any
 suggestions ? Thanks.


It's another place where WebLogic is not compliant to the JSP 1.1 specs, and
should be reported to them if it has not been yet.

The "locale" attribute of the html:html tag is a boolean (true or false)
property.  The JSP engine is supposed to do the conversions outlined in Table
2-4 of the JSP 1.1 specification.  The original spec did not make it clear that
this was required on custom tag attributes, but that was resolved in an Errata
published last year:

http://java.sun.com/products/jsp/errata_1_1_a_042800.html

See issue #7.


 cheers,
 Amar..


Craig McClanahan





Re: attribute blah has no value

2001-02-21 Thread Martin Cooper

You are trying to use nested double quotes, which is probably confusing the
parser somewhat. Try this instead:

hi:hello foo='%= request.getParameter("users") %' /

Hope this helps.

--
Martin Cooper
Tumbleweed Communications


- Original Message -
From: "Justin Kennedy" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 2:13 PM
Subject: attribute blah has no value


 HI all,

 I'm trying to use a dynamic value for an attribute of my tag. but I'm
 gettin this error:
 org.apache.jasper.compiler.ParseException:
 D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users
 has no value at

org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)


 Here's my tag entry in my tld file

 hi.tld

  tag
  namehello/name
  tagclassmycompany.HelloTag/tagclass
  bodycontentJSP/bodycontent
  attribute
  namefoo/name
  requiredtrue/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  /tag

 mycompany.HelloTag simply calls out.print(foo)

 Here's the JSP that generates the error.
 hi:hello foo="%= request.getParameter("users") %" /

 users doesn't actually exist in the request but it should just return null
 right ?
 so when I change my jsp to this:
 %
 String bar = request.getParameter("users");
 %
 hi:hello foo="%= bar %" /

 it prints out "null" and works just fine.

 Any suggestions ?
 Thanx






RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

I am not sure what you are looking for. The component library comes with
examples including a struts-template example that uses the component
library. 

The issue with components I was complaining about, albeit not clearly, was
that if a jsp that is part of a component instance and the jsp throws an
exception, the code surrounding the include will trap the exception and
print it to the browser. I would prefer that the exception was not caught so
that I could set up some global handler. Trapping the exception and printing
it to the browser means that the site operator won't know users are
experiencing trouble. 

Below is some of the offending code from
s1.struts.taglib.component.IncludeTag.java. Fixing it would involve trapping
the exceptions and throwing a JspException. Unfortunately that has its own
problems because JspExceptions can't nest the root exception so you don't
know exactly where the error occured. At least you know that something bad
happened. I am not planning to fix this problem for the time being, I am
just planning to write the jsps so they don't fail. :)

Hal

...
pageContext.include(page);
}
   catch (IOException ex)
{
processException( ex, "Can't include page '"+ page+ "' : " +
ex.getMessage() );
}
   catch (IllegalArgumentException ex)
{
// Can't resolve page uri
processException( ex, "Tag 'include' can't include page '" + page +
"'. Check if it exist.\n" + ex.getMessage() );
}
   catch (ServletException ex)
{
Throwable realEx = ex;
if( ex.getRootCause() != null )
  {
  realEx = ex.getRootCause();
  }
processException( realEx, "[ServletException in:"+ page+ "] " +
realEx.getMessage()+ "'" );
}
  catch (Exception ex) {
processException( ex, "[Exception in:" + page + "] "+
ex.getMessage());
}


-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:28 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts, WebLogic 6.0 and template tags


Hal,
Please give a code example with a component, when you cannot get an
exception.
And how it can be fix now.
Maya

"Deadman, Hal" wrote:

 I am using the components add-on and I like it but it shouldn't go into
the
 1.0 release. It's too much code and has too much functionality to be
merged
 without some more review which will take time. One problem I have noticed
is
 that when a component is included the exceptions are caught which makes it
 difficult to have any kind of global error handler. That's an easy fix but
 merging the code will not be a trivial effort.

 Besides, there is no compelling reason to add it to struts now because
there
 is nothing to stop people using struts from also using the components
 framework. When it is added to struts there will probably be some re-work
 involved but it should be straightforward.

 Hal




Re: multiple login

2001-02-21 Thread Wong Kok Wai

What I did is to write a login singleton that
maintains a table of login users and their session. If
the same user login again with a new session, the
previous session is invalidated. 

It would be nice if Struts can handle this too.

--- Maya Muchnik [EMAIL PROTECTED] wrote:
 Hi,
 
  In other mail list it was a lot of discussion about
 a user login /
 logon through multiple web pages or different
 browser. They have
 discussed how to prevent the multiple login. My
 question is this: does
 struts provide an easy way (or some way) to handle
 this situation or
 not?
 
 Maya
 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/



Re: help! confused over forms and errors and oooh, other stuff :-)

2001-02-21 Thread Craig R. McClanahan

Ned Seagoon wrote:

 Hi Maya,

 Yep I believe that struts has a great future. I do believe that it is the
 model we should be working with. I am just worried that because of the
 current limitations that we will not use it. There are whole swathes of
 stuff that needs to be done, especially when it comes to
 internationalisation/formatting support when it comes to the view output,

"Many hands make light work."  Volunteers are welcome to assist :-).


 but that is not a problem. Custom tags can be built to handle what is
 required (as I have done so) but the internal workings of the actionServlet
 is a different matter. If that does not support what you want then you end
 up having to branch away from the codeline (which I don't want to do, it's a
 maintenance nightmare).

 We use log4J here. Now that log4j is under the apache wing, I take it that
 tomcat and struts will start to use it at some point?


I have been hoping that the JSR for a standard logging API would be done fairly
quickly, so that you could plug in any logging environment you wanted.  I expect
that LOG4J will quickly and easily conform to the new API when it's finalized.

Until then, I am a little hesitant to commit to any particular logging API,
because then we'd have to change it for the standard one later anyway.


 Regards
 Ned


Craig McClanahan





Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Maya Muchnik

Hello, Torsen,

It is not an answer to your question. But I would like to use this email and
ask the struts development team about compatibility template library and
components library (http://www.lifl.fr/~dumoulin/components/). Components allow
to define "instances" to reuse them with different parameter values. They have
good examples how to use them for implementation. They do not have a "role"
attribute yet. Both components and templates have a lot of common. Why not
combine the best parts both of them and put under struts project before 1.0
release?

"Beuck, Torsten" wrote:

 Hi, we like to use Struts with Bea WLS 6.0 for a B2B application. Currently
 I am developing a prototype and the first tests under Tomcat worked fine. I
 used the Struts template tags for a page design with header, navigation menu
 and content. An example:

 %@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %

 template:insert template='/pageTemplate.jsp'
   template:put name='logo' content='/logo.jsp' /
   template:put name='header' content='/header.jsp' /
   template:put name='menu' content='/menu.jsp' /
   template:put name='content' content='/content.jsp'/
 /template:insert





Re: attribute blah has no value

2001-02-21 Thread Craig Tataryn

What if you changed the outter quotes to single quotes?

hi:hello foo='%= request.getParameter("users") %' /

I don't know if that makes a difference, but worth a try anyway.

tataryn:craig/

Justin Kennedy wrote:

 HI all,

 I'm trying to use a dynamic value for an attribute of my tag. but I'm
 gettin this error:
 org.apache.jasper.compiler.ParseException:
 D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users
 has no value at
 org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)

 Here's my tag entry in my tld file

 hi.tld

  tag
  namehello/name
  tagclassmycompany.HelloTag/tagclass
  bodycontentJSP/bodycontent
  attribute
  namefoo/name
  requiredtrue/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  /tag

 mycompany.HelloTag simply calls out.print(foo)

 Here's the JSP that generates the error.
 hi:hello foo="%= request.getParameter("users") %" /

 users doesn't actually exist in the request but it should just return null
 right ?
 so when I change my jsp to this:
 %
 String bar = request.getParameter("users");
 %
 hi:hello foo="%= bar %" /

 it prints out "null" and works just fine.

 Any suggestions ?
 Thanx

--
I've been trying to change the world for years, but they just won't give me the
source code



begin:vcard 
n:Tataryn;Craig
tel;home:952-884-6752
tel;work:952-842-5576
x-mozilla-html:TRUE
url:http://www.computer-programmer.org
org:Compuware;Professional Division
adr:;;3600 West 80th St. Suite 400;Bloomington;MN;55431;United States of America
version:2.1
email;internet:[EMAIL PROTECTED]
title:Senior Staff Analyst
fn:Craig Tataryn
end:vcard



Re: passing substitution parameters to ActionError still working?

2001-02-21 Thread Craig R. McClanahan


"Deadman, Hal" wrote:
I
have a form where I call the following (where UserForm.MIN_PASSWORD_LENGTH
is an int):errors.add("password",
new ActionError("error.user.passwordinvalid", String.valueOf(UserForm.MIN_PASSWORD_LENGTH)));which
references this in the ApplicationResource.properties file:error.user.passwordinvalid=li>The
password must contain at least {0} characters./li>But
the html:error tag displays this:

The password must contain at least [Ljava.lang.Object;@14f467
characters.
I
could have sworn that this used to work but it doesn't anymore for me.
Does passing parameters to ActionError objects still work for everyone
with recent builds? If it still works then I must have broke something.Thanks,
Hal

You should be able to pass the length as an object of type Integer,
and let the message formatting methods worry about converting it to a String:
 errors.add("password", new ActionError("error.user.passwordinvalid",
 new Integer(UserForm.MIN_PASSWORD_LENGTH));
The parameter values are all Objects rather than Strings.
Craig



validator.xml - rules for a mask

2001-02-21 Thread Maya Muchnik

Hi, all.

This email about David Winterfeldt's validator. What are rules to make a
mask? As I understood a default validator.xml was created for an
example. If I need to create my own validator.xml what are the rules?

Thanks in advance,

Maya




Re: File Upload

2001-02-21 Thread Ji Rong Hu



Thanks for all you helps.

Just for your information. My version of that sample will not work because there
is a duplicated tag in struts-html.tld,
=
attribute
nameimageName/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
/attribute
==
delete either one will work.

Jirong










"Craig R. McClanahan" [EMAIL PROTECTED] on 02/22/2001 10:30:40 AM

Please respond to [EMAIL PROTECTED]





  
  
  
 To:  [EMAIL PROTECTED]  
  
 cc:  (bcc: Ji Rong Hu/Singapore/Netlife) 
  
  
  
 Subject: Re: File Upload 
  








There is a complete example application using file upload in the
"struts-upload.war" file -- check in the "webapps" directory.

Craig McClanahan


Ji Rong Hu wrote:

 Hi, can anyone give me an example on file uploading within Struts?
 Thanks,
 Jirong




Disclaimer  :

The information contained in this email is intended solely for the addressee.
Access to this email by anyone else is unauthorized. If you are not the intended
recipient, any form of disclosure, reproduction, distribution or any action
taken or refrained from in reliance on it, is prohibited and may be unlawful.
Please notify the sender immediately. The content of this email is not legally
binding unless confirmed by letter. The sending of emails to us will not
constitute compliance with any time limits or deadlines. We also like to inform
you that communication via email over the internet is insecure because third
parties may have the possibility to access and manipulate emails.







Re: Missing struts-config_1_0.dtd when not logged on

2001-02-21 Thread Tom Miller

Thanks Donnie, that worked just fine.

But once past struts_config.xml, and the ActionServlet attempts to parse the web app 
deployment descriptor (i.e. WEB-INF/web.xml) I get the following. And hints here? I 
looked for but could not find a similar place to turn off validating as with 
struts_config.xml. I wonder what the chances are that this would have been fixed in 
the last night's version. I suppose if this is a bug, it is just now surfacing.

resolveEntity('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 
'http://java.sun.com/j2ee/dtds/web-app_2_2.dtd')
 Not registered, use system identifier
Parse Fatal Error at line 5 column -1: External entity not found: 
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd".
org.xml.sax.SAXParseException: External entity not found: 
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd".
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 org.xml.sax.SAXException(java.lang.String, java.lang.Exception)
 org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator, 
java.lang.Exception)
 void com.sun.xml.parser.Parser.fatal(java.lang.String, java.lang.Object [], 
java.lang.Exception)
 void 
com.sun.xml.parser.Parser.externalParameterEntity(com.sun.xml.parser.ExternalEntity)
 boolean com.sun.xml.parser.Parser.maybeDoctypeDecl()
 void com.sun.xml.parser.Parser.parseInternal(org.xml.sax.InputSource)
 void com.sun.xml.parser.Parser.parse(org.xml.sax.InputSource)
 void javax.xml.parsers.SAXParser.parse(org.xml.sax.InputSource, 
org.xml.sax.HandlerBase)
 void javax.xml.parsers.SAXParser.parse(java.io.InputStream, org.xml.sax.HandlerBase)
 java.lang.Object org.apache.struts.digester.Digester.parse(java.io.InputStream)
 void org.apache.struts.action.ActionServlet.initServlet()
 void org.apache.struts.action.ActionServlet.init()
 void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
 void org.apache.tomcat.core.ServletWrapper.doInit()
 void org.apache.tomcat.core.Handler.init()
 void org.apache.tomcat.core.ServletWrapper.init()
 void 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(org.apache.tomcat.core.Context)
 void org.apache.tomcat.core.ContextManager.initContext(org.apache.tomcat.core.Context)
 void org.apache.tomcat.core.ContextManager.init()
 void org.apache.tomcat.startup.Tomcat.execute(java.lang.String [])
 void org.apache.tomcat.startup.Tomcat.main(java.lang.String [])
 java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object 
[])
 void TomcatStart.start(java.lang.String [], java.lang.String)
 void TomcatStart.main(java.lang.String [])

--
Tom Miller
Miller Associates, Inc.
[EMAIL PROTECTED]
641.469.3535 Phone
413.581.6326 FAX





Re: File Upload

2001-02-21 Thread Ji Rong Hu



Hi, guys, I am going to lunch. I think it's wise to use this time to just ask
before I doing a test, can anyone tell me that:

is these data, include file data, still avaiable in HttpServletRequst object?
Why, because out old EJB object extract these data from HttpServletRequst.

Thanks,
Jirong


The following is the "upload" example which enables you get these info from Form
bean.
=

public class UploadAction extends Action {

 public ActionForward perform(ActionMapping mapping,
 ActionFormform,
 HttpServletRequest request,
 HttpServletResponse
response) {

  if (form instanceof UploadForm) {

   UploadForm theForm = (UploadForm) form;

   //retrieve the text data
   String text = theForm.getTheText();

   //retrieve the file representation
   FormFile file = theForm.getTheFile();

   //retrieve the file name
   String fileName= file.getFileName();

   //retrieve the content type
   String contentType = file.getContentType();

   //retrieve the file size
   String size = (file.getFileSize() + " bytes");

   String data = null;

   try {
//retrieve the file data
data = new String(file.getFileData());
   }
   catch (FileNotFoundException fnfe) {
return null;
   }
   catch (IOException ioe) {
return null;
   }

   //place the data into the request for retrieval from display.jsp
   request.setAttribute("text", text);
   request.setAttribute("fileName", fileName);
   request.setAttribute("contentType", contentType);
   request.setAttribute("size", size);
   request.setAttribute("data", data);

   //destroy the temporary file created
   file.destroy();

   //return a forward to display.jsp
   return mapping.findForward("display");
  }

  //this shouldn't happen in this example
  return null;
 }




Disclaimer  :

The information contained in this email is intended solely for the addressee.
Access to this email by anyone else is unauthorized. If you are not the intended
recipient, any form of disclosure, reproduction, distribution or any action
taken or refrained from in reliance on it, is prohibited and may be unlawful.
Please notify the sender immediately. The content of this email is not legally
binding unless confirmed by letter. The sending of emails to us will not
constitute compliance with any time limits or deadlines. We also like to inform
you that communication via email over the internet is insecure because third
parties may have the possibility to access and manipulate emails.






Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Cedric Dumoulin


  Thanks all for you comments on Components library.

  Unfortunately, I have less and less time for Components. So, if there is some
volunteers to improve them, let me know.  I will soon put Components project on
a CVS server. This will allows others people to participate ...

Cedric


"Deadman, Hal" wrote:

 I am using the components add-on and I like it but it shouldn't go into the
 1.0 release. It's too much code and has too much functionality to be merged
 without some more review which will take time. One problem I have noticed is
 that when a component is included the exceptions are caught which makes it
 difficult to have any kind of global error handler. That's an easy fix but
 merging the code will not be a trivial effort.

 Besides, there is no compelling reason to add it to struts now because there
 is nothing to stop people using struts from also using the components
 framework. When it is added to struts there will probably be some re-work
 involved but it should be straightforward.

 Hal

 -Original Message-
 From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 10:48 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Struts, WebLogic 6.0 and template tags

 Hello, Torsen,

 It is not an answer to your question. But I would like to use this email and
 ask the struts development team about compatibility template library and
 components library (http://www.lifl.fr/~dumoulin/components/). Components
 allow
 to define "instances" to reuse them with different parameter values. They
 have
 good examples how to use them for implementation. They do not have a "role"
 attribute yet. Both components and templates have a lot of common. Why not
 combine the best parts both of them and put under struts project before 1.0
 release?

 "Beuck, Torsten" wrote:

  Hi, we like to use Struts with Bea WLS 6.0 for a B2B application.
 Currently
  I am developing a prototype and the first tests under Tomcat worked fine.
 I
  used the Struts template tags for a page design with header, navigation
 menu
  and content. An example:
 
  %@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %
 
  template:insert template='/pageTemplate.jsp'
template:put name='logo' content='/logo.jsp' /
template:put name='header' content='/header.jsp' /
template:put name='menu' content='/menu.jsp' /
template:put name='content' content='/content.jsp'/
  /template:insert
 




RE: taglib error when running struts1.0 on weblogic 5.1

2001-02-21 Thread Nanduri, Amarnath

Hi Harish,

 I do have the struts.jar file in the web-inf/lib  directory. 

cheers,
Amar..

-Original Message-
From: Dorai, Harish (c) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:08 AM
To: '[EMAIL PROTECTED]'
Subject: RE: taglib error when running struts1.0 on weblogic 5.1 


Do you have the "struts.jar" file in the WEB-INF/lib directory of your Web
application? If not, that could be the reason for the exception.


-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:03 AM
To: '[EMAIL PROTECTED]'
Subject: taglib error when running struts1.0 on weblogic 5.1 


Hi all,

   I created a sample application of my own. I am getting a taglib error
when trying to access a jsp page ? Any suggestions will be appreciated. 

The steps i went though are..
. I created a jar file and re-named it as a war file . I followed the same
structure as the example application given with struts 1.0

. I was able to run the example application without any problem. The problem
comes when i try to run my application. Below is the exception i get... Any
help is very much appreciated. Thanks.


cheers,
Amar..



Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo resolving
taglib ur
i '/WEB-INF/struts-bean.tld' to taglib-location /WEB-INF/struts-bean.tld:
Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
taglib
uri /WEB-INF/struts-bean.tld as resource /WEB-INF/WEB-INF/struts-bean.tld in
Web
 Application root:
Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
taglib
uri /WEB-INF/struts-bean.tld as resource /WEB-INF/struts-bean.tld in Web
Applica
tion root:
java.io.IOException: cannot resolve '/WEB-INF/struts-bean.tld' into a valid
tag
library
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:94)
at
weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, C
ompiled Code)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java,
Compil
ed Code)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled
Code
)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1760)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1601)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
Code)

at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:164)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:101)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:907)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:851)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:364)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
Wed Feb 21 10:50:00 EST 2001:E WebAppServletContext-demo Root cause of
Servl
etException
weblogic.utils.ParsingException: nested IOException: java.io.IOException:
cannot
 resolve '/WEB-INF/struts-bean.tld' into a valid tag library
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:164)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:101)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:907)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:851)
at

Re: Question on checkbox

2001-02-21 Thread Wong Kok Wai

The "value" attribute only allows for boolean related
values which currently only recongnise "true", "on"
and "yes".

--- Choon Yin Teo [EMAIL PROTECTED] wrote:
 
 
 
 Hi ,
 
 Have anyone encountered any problem using the
 following strut checkbox?
 form:checkbox property="command" value="search" /
 
 I encountered a problem trying to retrieve the
 value. When I view the static
 html source, I can't see the value set.
 input type="checkbox" name="command" 
 
 Regards,
 Choon Yin
 
 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/



submitting form containing an object with indexed property

2001-02-21 Thread Jason H. Kim

I am trying to submit an ActionForm instance upon submission of a form. But
I think it's sending each properties as request parameter and not the whole
object. The object that subsequent Action receives is a newly constructed
(the one created by ActionForm form = new ActionForm()) one. Following is
the jasper.log:

JspEngine -- /TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001ServletPath:
/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001   PathInfo:
null/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001   RealPath:
/www/time-dev/webapps/time/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001 RequestURI:
/TaskBasedComment.jsp/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001QueryString:
null/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001 Request Params: /JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001fridayHour[1] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001saturdayHour[2] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001wednesdayHour[0] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001sundayHour[2] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001fridayHour[4] =
0.0/JASPER_LOG
JASPER_LOG Wed Feb 21 11:40:14 CST 2001thursdayHour[0] =
0.0/JASPER_LOG
...



The form "displayed" the object just fine, using index properties and such,
but failed to "submit" the object. I looked at my configuration file and my
jsp source and i can't find anything..


Following is my struts-config.xml:
  form-beans
form-bean
  name="com.qett.time.bean.timeformbean"
  type="com.qett.time.bean.TimeFormBean" /
  /form-beans
  action-mappings
actionpath="/hourinput"
   type="com.qett.time.servlet.HourInputAction"
   name="com.qett.time.bean.timeformbean"
  scope="request"
  input="TaskBasedTime.jsp"
   validate="true"
  forward name="success"path="/TaskBasedComment.jsp"/
/action
  /action-mappings

and following is my jsp page.. it gets the bean
com.qett.time.bean.timeformbean as a request parameter from previously
executed Action - The form is pre-populated.



html:form action="/hourinput.do"

table align="center" class="BoxWithHeader" width="700"
tr
td colspan="9" align="center"
table width="100%" cellpadding="0" cellspacing="0"

%
int i;
for (i = 0; itime.getArraySize(); i++) {
String styleClass = "ReportRowOdd";
if ((i % 2)==0) {
styleClass = "ReportRowEven";
}
String prop0 = "projectToTaskMap[" + i + "]";
String prop1 = "indexName["+i+"]";
String prop2 = "sundayHour["+i+"]";
String prop3 = "mondayHour["+i+"]";
String prop4 = "tuesdayHour["+i+"]";
String prop5 = "wednesdayHour["+i+"]";
String prop6 = "thursdayHour["+i+"]";
String prop7 = "fridayHour["+i+"]";
String prop8 = "saturdayHour["+i+"]";
String prop9 = "SPTotalTime["+i+"]";
%
!-- In the following write tags, name field should match that of the Bean
specified in struts-config.xml --
tr
td width="140" align="center" class=%= styleClass %bean:write
name="com.qett.time.bean.timeformbean" property="%= prop1 %" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop2 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop3 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop4 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop5 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop6 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop7 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %html:text
name="com.qett.time.bean.timeformbean" property="%= prop8 %" size="3"
maxlength="4" //td
td width="70" align="center" class=%= styleClass %bean:write
name="com.qett.time.bean.timeformbean" 

i18n, formatting message

2001-02-21 Thread Kan Leung, MK

Hi all,

I have a property file like this:

  common.copyright={0} Copyright

I used the following tag to retrieve the message:

  bean:message key="common.copyright" arg0="2001"/

The displayed message becomes:

  [Ljava.lang.Object;@47393f Copyright


Any clue?


--
Kan LEUNG, M K
email: [EMAIL PROTECTED]
Digital Empires Company Limited







Re: ActionForm.reset()

2001-02-21 Thread Craig R. McClanahan

Christian Billen wrote:

 Hi list,

 Is there a way to prevent the reset() method from being called on the
 ActionForm when the validate option in struts-config for that mapping is set
 to false?


Doing this would break the recommended approach for dealing with checkboxes,
which rely on reset() being called to reset the corresponding booleans to
false.  You will want this to occur even if you are not validating, so that the
bean properties correctly reflect what the user last entered.


 My problem is that I have an Action to prepare the data for a jsp page and
 another Action to process the data from that jsp. Both point to the same
 ActionForm class.
 In my prep action (/prepare.do), I configured the mapping not to validate
 the form, but still I see that the reset() method is being called, very
 annoying considering that some properties in my actionform are set to a
 default in the constructor (like a checkbox set to true) and that I have
 code in reset of the same form to clear checkboxes.  Shouldn't reset be
 called by the controller only when validate is true?


The Struts example application faces a similar situation.  In the
EditSubscriptionAction, it creates a new form bean (initialized to defaults in
the constructor) and *replaces* the one that was created by the controller
servlet (and on which reset() was called).  You might consider using a similar
technique.

Craig McClanahan



 Thanks for your advise,

 Christian Billen




RE: taglib error when running struts1.0 on weblogic 5.1

2001-02-21 Thread rhayden


And all the necessary *.tlds are in .../WEB-INF right? If you continue to
have problems you may want to try leaving the archive expanded, and adding
two entries to the WL classpath: struts.jar and the path to the .../classes
directory. You also need to update WL.properties to point to the directory
of the app instead of the war.  I know that this is not desirable, putting
struts.jar in the classpath, but the WL classpath (and classloader) is
different and I have found this is needed to get things to work if you try
to deploy an expanded archive. Not exactly a good answer, but it might allow
you to continue with development.

There are some issues with a few of the tags and WL that involve URL
encoding, so if you are trying to use one of these tags you will have
problems. You can see which ones these are by running the struts test app.
But I think this results in a different error.


 -Original Message-
 From: Nanduri, Amarnath [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 11:10 AM
 To:   '[EMAIL PROTECTED]'
 Subject:  RE: taglib  error when running struts1.0  on weblogic 5.1 
 
 Hi Harish,
 
  I do have the struts.jar file in the web-inf/lib  directory. 
 
 cheers,
 Amar..
 
 -Original Message-
 From: Dorai, Harish (c) [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 11:08 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: taglib error when running struts1.0 on weblogic 5.1 
 
 
 Do you have the "struts.jar" file in the WEB-INF/lib directory of your Web
 application? If not, that could be the reason for the exception.
 
 
 -Original Message-
 From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 21, 2001 11:03 AM
 To: '[EMAIL PROTECTED]'
 Subject: taglib error when running struts1.0 on weblogic 5.1 
 
 
 Hi all,
 
I created a sample application of my own. I am getting a taglib error
 when trying to access a jsp page ? Any suggestions will be appreciated. 
 
 The steps i went though are..
 . I created a jar file and re-named it as a war file . I followed the same
 structure as the example application given with struts 1.0
 
 . I was able to run the example application without any problem. The
 problem
 comes when i try to run my application. Below is the exception i get...
 Any
 help is very much appreciated. Thanks.
 
 
 cheers,
 Amar..
 
 
 
 Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo resolving
 taglib ur
 i '/WEB-INF/struts-bean.tld' to taglib-location /WEB-INF/struts-bean.tld:
 Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
 taglib
 uri /WEB-INF/struts-bean.tld as resource /WEB-INF/WEB-INF/struts-bean.tld
 in
 Web
  Application root:
 Wed Feb 21 10:50:00 EST 2001:I WebAppServletContext-demo looking for
 taglib
 uri /WEB-INF/struts-bean.tld as resource /WEB-INF/struts-bean.tld in Web
 Applica
 tion root:
 java.io.IOException: cannot resolve '/WEB-INF/struts-bean.tld' into a
 valid
 tag
 library
 at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:94)
 at
 weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, C
 ompiled Code)
 at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java,
 Compil
 ed Code)
 at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java,
 Compiled
 Code
 )
 at
 weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1760)
 at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1601)
 at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
 Code)
 
 at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled
 Code)
 at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
 Code)
 at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
 at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
 at
 weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
 mpiled Code)
 at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
 Code)
 
 at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217)
 at
 weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
 java:164)
 at
 weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
 pl.java:101)
 at
 weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
 pl.java:124)
 at
 weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
 textImpl.java:907)
 at
 weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
 textImpl.java:851)
 at
 weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
 ContextManager.java:252)
 at
 weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
 a:364)
 at
 weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
 
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
 Code)
 Wed Feb 21 10:50:00 EST 2001:E 

Re: auto reload of message resource and URL-rewrite

2001-02-21 Thread Craig R. McClanahan

"Kan Leung, MK" wrote:

 Hi,

 Extracted from struts-example's walking tours:

 "You can even reload the configuration and message resources without
 restarting the container. See the end of the web.xml file for details."

 * My 1st question is: how to achieve auto reload of message resources?


At the bottom of the struts-config.xml file for the example application, you
will see an action definition:

action path="/admin/reload"
type="org.apache.struts.actions.ReloadAction"/

which means you can send a request to the following URL (assuming the normal
*.do mapping):

http://localhost:8080/struts-example/admin/reload.do

and the Struts controller servlet will reload all of the configuration files
and message resources (but not the Java classes -- you have to ask your
servlet container to reload the app in order to accomplish that).

You can use any of these standard actions in your own applications as well.


 * My 2nd question is about "struts-example". Everytime when I load
 "http://localhost/struts-documentation/", the image is never loaded
 successfully at during first time. I viewed the source it the IMG_SRC is
 "/struts-example/struts-power.gif;jsessionid=nhiizz1yq1". May I know why
 URL-rewrite is invoked for my browser, which cookie capability is
 properly enabled?

 The image is loaded successfully when I pressed "reload" on my browser.
 The string ";jsessionid*" is gone.

What servlet container are you using?  Some containers (such as Tomcat 3.2
running behind Apache) do not correctly deal with URL-rewritten session ids
unless you modify their configuration slightly -- in this case, you have to
define a "rewrite rule" in the Apache configuration file to make it work.

The details are in the Tomcat FAQ-O-MATIC, which you can reach via
http://jakarta.apache.org.  Search for an entry containing the words "URL
rewriting" and you will find the setup details.

 --
 Kan LEUNG, M K
 email: [EMAIL PROTECTED]
 Digital Empires Company Limited

Craig McClanahan





Question on checkbox

2001-02-21 Thread Choon Yin Teo




Hi ,

Have anyone encountered any problem using the following strut checkbox?
form:checkbox property="command" value="search" /

I encountered a problem trying to retrieve the value. When I view the static
html source, I can't see the value set.
input type="checkbox" name="command" 

Regards,
Choon Yin





Small problem with TRANSACTION_TOKEN_KEY + multipart support

2001-02-21 Thread Richard Reich

The transaction enforcement support in class Action assumes that the key
will be returned in the request attributes.  This is not the case with pages
that require multipart support (for file uploads, for example).  A direct
work-around exists -- just use the generateToken() and saveToken() methods,
handle schlepping the key in the form yourself, and write your own one-liner
to compare the schlepped key with the stored one.

It took me an embarrassingly long time to find this problem because of my
(deserved) faith in Struts. g  Maybe it should be documented, though
devoting resources to fix it now is probably not necessary.

-r

Richard Reich
http://reich.com
http://calendar.yahoo.com/richard+reich





SV: Problem w/ Struts and VA for Java

2001-02-21 Thread Jerzy Kawa

Hi Ned !
I'm using VAJ 3.5.2 with Tomcat 3.2.1 with your setup.
The displayed message becomes:

--
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /examples )
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages 
2001-02-22 08:01:46 - ContextManager: Adding context Ctx(  )
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /struts-documentation )
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /struts-example )
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /struts-upload )
2001-02-22 08:01:46 - ContextManager: Adding context Ctx( /test )
java.lang.reflect.InvocationTargetException: java.lang.ExceptionInInitializerError: 
java.util.MissingResourceException: Can't find resource for base name 
javax.servlet.http.LocalStrings, locale en_US
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.lang.RuntimeException(java.lang.String)
 java.util.MissingResourceException(java.lang.String, java.lang.String, 
java.lang.String)
 java.util.ResourceBundle java.util.ResourceBundle.getBundle(java.lang.String, 
java.util.Locale, java.lang.ClassLoader)
 java.util.ResourceBundle java.util.ResourceBundle.getBundle(java.lang.String)
 java.lang.Object java.lang.Class.newInstance0()
 java.lang.Object java.lang.Class.newInstance()
 void org.apache.tomcat.core.ServletWrapper.loadServlet()
 void org.apache.tomcat.core.ServletWrapper.init()
 void 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(org.apache.tomcat.core.Context)
 void org.apache.tomcat.core.ContextManager.initContext(org.apache.tomcat.core.Context)
 void org.apache.tomcat.core.ContextManager.init()
 void org.apache.tomcat.startup.Tomcat.execute(java.lang.String [])
 void org.apache.tomcat.startup.Tomcat.main(java.lang.String [])
 java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object 
[])
 void TomcatRunner.start(java.lang.String [], java.lang.String)
 void TomcatRunner.main(java.lang.String [])

Any clue?
Jerzy Kawa
- Original Message - 
From: Ned Seagoon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 5:39 PM
Subject: Re: Problem w/ Struts and VA for Java


 
 Hi Tom,
 
 I'm using VAJ 3.5.2 with Tomcat 3.2.1 with no problems at all. Here is my 
 setup:
 
 Get rid of any IBM WTE stuff
 Import the servlet.jar from tomcat into it's own project
 Import all the struts source and resources into its own project
 Create a class in a package in another project called 'TomcatRunner' (code 
 follows at the end of this mail)
 right click on tomcat runner and set the properties
 in properties set tomcat.home=c:\yourwebhome
 
 on the class path page set the 'extra directories' path to be
 c:\TomcatLocal\lib\webserver.jar;
 c:\TomcatLocal\lib\ant.jar;
 c:\TomcatLocal\lib\jasper.jar;
 c:\TomcatLocal\lib\jaxp.jar;
 c:\TomcatLocal\lib\parser.jar;
 
 (or whatever your directories are)
 
 And in the project path add the VAJ projects for the servlet API and struts, 
 plus whatever your own app project is. And that should be it, you can edit 
 and debug your own code and the struts source in VAJ.
 
 Your problems will come if you try to import Tomcat into VAJ. That I have 
 not managed to do sucessfully!
 
 Hope that helps!
 Ned
 
 TomcatRunner.java:
 
 import java.lang.reflect.*;
 
 public class TomcatRunner {
 
   public TomcatRunner() {
 super();
   }
 
   public static void main(java.lang.String[] args) {
 TomcatRunner runner = new TomcatRunner();
 runner.start(args, "org.apache.tomcat.startup.Tomcat");   }
 
   public void start(String[] args, String className) {
 try {
   Class cls = Class.forName(className);
   if (cls != null) {
 Method main = cls.getMethod("main",new Class[] {new 
 String[]{}.getClass()});
 if(main != null) {
   Object [] mainArgs = new Object [] {args};
   main.invoke(null,mainArgs);
 }
   }
 } catch (ClassNotFoundException e) {
   System.out.println("Unable to find the class "+className);   
 System.out.println("Set properties as described in this class' javadoc.");
 } catch (Exception e) {
   e.printStackTrace();
 }
   }
 }
 
 
 
 From: Tom Miller [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Problem w/ Struts and VA for Java
 Date: Tue, 20 Feb 2001 10:14:27 -0600
 
 Struts people
 
 I had great success using VAJ to develop Struts applications a few
 months ago, but recently upgraded my Tomcat to 3.2.1 and Struts to
 recent releases. I lost the ability to develop and debug my Struts
 application classes within VAJ.
 
 Craig's excellently clear message of Feb. 13th (#4566) entitled
 'Classpaths and the "struts.jar" file' gave, I believe, the reason.
 Craig explained that containers (esp. Tomcat 3.x and 4.x) use custom
 class loaders that *must* find struts.jar and application classes in the
 WEB-INF 

Re: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread David Geary

"Craig R. McClanahan" wrote:

 Maya Muchnik wrote:

  Hello, Torsen,
 
  It is not an answer to your question. But I would like to use this email and
  ask the struts development team about compatibility template library and
  components library (http://www.lifl.fr/~dumoulin/components/). Components allow
  to define "instances" to reuse them with different parameter values. They have
  good examples how to use them for implementation. They do not have a "role"
  attribute yet. Both components and templates have a lot of common. Why not
  combine the best parts both of them and put under struts project before 1.0
  release?
 

 There is no end to good ideas for improvements to Struts, and the components
 library is one of them.  However, if we kept adding new functionality we'd never
 have a 1.0 release, and that's not good either.

 This is definitely high on my personal priority list to look at for 1.1.

Me too. As soon as I get my book out the door, I'll take a look at adding components
to Struts.


david (the Struts templates guy)




Re: validator.xml - rules for a mask

2001-02-21 Thread Martin Cooper

The validator uses the Jakarta Regexp regular expression package. You can
find more about it here:

http://jakarta.apache.org/regexp/

If you follow the link to the JavaDoc, and look at the documentation for the
RE class, you'll find the specification of the syntax it works with.

Hope this helps.

--
Martin Cooper
Tumbleweed Communications


- Original Message -
From: "Maya Muchnik" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 3:07 PM
Subject: validator.xml - rules for a mask


 Hi, all.

 This email about David Winterfeldt's validator. What are rules to make a
 mask? As I understood a default validator.xml was created for an
 example. If I need to create my own validator.xml what are the rules?

 Thanks in advance,

 Maya






Re: validator.xml - rules for a mask

2001-02-21 Thread David Winterfeldt

Here's the link directly to the javadoc online.
http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html

There are a lot of good tutorials on regular
expressions.  This package follows Perl regular
expression syntax so you can read any Perl regexp
tutorial you find.

David


--- Martin Cooper [EMAIL PROTECTED]
wrote:
 The validator uses the Jakarta Regexp regular
 expression package. You can
 find more about it here:
 
 http://jakarta.apache.org/regexp/
 
 If you follow the link to the JavaDoc, and look at
 the documentation for the
 RE class, you'll find the specification of the
 syntax it works with.
 
 Hope this helps.
 
 --
 Martin Cooper
 Tumbleweed Communications
 
 
 - Original Message -
 From: "Maya Muchnik" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, February 21, 2001 3:07 PM
 Subject: validator.xml - rules for a mask
 
 
  Hi, all.
 
  This email about David Winterfeldt's validator.
 What are rules to make a
  mask? As I understood a default validator.xml was
 created for an
  example. If I need to create my own validator.xml
 what are the rules?
 
  Thanks in advance,
 
  Maya
 
 
 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/



RE: File Upload

2001-02-21 Thread Schachter, Michael


 Ji Rong Hu,

The file upload example you are using is old and uses the deprecated (or at
least not recommended to use) getFileData() method.  The recomended method
is to use the getInputStream() method to obtain an input stream to the form
file and read it that way.  I attached the newer UploadAction source file
that uses this method.  You can find this in any recent build of Struts.

-Original Message-
From: Ji Rong Hu
To: [EMAIL PROTECTED]
Sent: 2/21/01 10:45 PM
Subject: Re: File Upload



Hi, guys, I am going to lunch. I think it's wise to use this time to
just ask
before I doing a test, can anyone tell me that:

is these data, include file data, still avaiable in HttpServletRequst
object?
Why, because out old EJB object extract these data from
HttpServletRequst.

Thanks,
Jirong


The following is the "upload" example which enables you get these info
from Form
bean.
=

public class UploadAction extends Action {

 public ActionForward perform(ActionMapping mapping,
 ActionFormform,
 HttpServletRequest
request,
 HttpServletResponse
response) {

  if (form instanceof UploadForm) {

   UploadForm theForm = (UploadForm) form;

   //retrieve the text data
   String text = theForm.getTheText();

   //retrieve the file representation
   FormFile file = theForm.getTheFile();

   //retrieve the file name
   String fileName= file.getFileName();

   //retrieve the content type
   String contentType = file.getContentType();

   //retrieve the file size
   String size = (file.getFileSize() + " bytes");

   String data = null;

   try {
//retrieve the file data
data = new String(file.getFileData());
   }
   catch (FileNotFoundException fnfe) {
return null;
   }
   catch (IOException ioe) {
return null;
   }

   //place the data into the request for retrieval from
display.jsp
   request.setAttribute("text", text);
   request.setAttribute("fileName", fileName);
   request.setAttribute("contentType", contentType);
   request.setAttribute("size", size);
   request.setAttribute("data", data);

   //destroy the temporary file created
   file.destroy();

   //return a forward to display.jsp
   return mapping.findForward("display");
  }

  //this shouldn't happen in this example
  return null;
 }




Disclaimer  :

The information contained in this email is intended solely for the
addressee.
Access to this email by anyone else is unauthorized. If you are not the
intended
recipient, any form of disclosure, reproduction, distribution or any
action
taken or refrained from in reliance on it, is prohibited and may be
unlawful.
Please notify the sender immediately. The content of this email is not
legally
binding unless confirmed by letter. The sending of emails to us will not
constitute compliance with any time limits or deadlines. We also like to
inform
you that communication via email over the internet is insecure because
third
parties may have the possibility to access and manipulate emails.




 UploadAction.java