Error in EqualTag when parsing JSP

2001-01-11 Thread Oliphant, Geoff

Error in tag library at: 'logic': The Tag class
'org.apache.struts.taglib.logic.EqualTag' has no setter method corresponding
to TLD declared attribute 'scope', (JSP 1.1 spec, 5.4.1)

I get this error when a jsp is being parsed.  I have the build from
10/01/2001 (the night before last) and only have the struts-logic import at
the top of the jsp - no tags have been implemented in the jsp yet.

The import is:

<%@ taglib uri="/tld/struts-logic.tld" prefix="logic" %>

Any ideas?

Cheers

Geoff





 IMPORTANT INFORMATION

This message and any files transmitted with it are confidential and should be read 
only by those
persons to whom it is addressed.   
If you have received this message in error, please notify us immediately by way of 
reply. Please
also destroy and delete the message from your computer. Any unauthorised form of 
reproduction
of this message is strictly prohibited.

It is the duty of the recipient to virus scan and otherwise test the information 
provided before
loading onto any computer system.  
SEALCORP does not warrant that the information is free of a virus or any other defect 
or error.

SEALCORP is not liable for the proper and complete transmission of the information 
contained in
this communication, nor for any delay in its receipt.

Any views expressed in this message are those of the individual sender, except where 
the sender
specifically states them to be the views of SEALCORP.





Re: Strange problem using Weblogic 6.0

2001-01-11 Thread Thierry Cools



If you are interested, I found a way to avoid the problem, it doesn't solve 
it, but at least it allows me to continue to migrate my application from Tomcat 
to Weblogic.
The solution is to have a 'weblogic.xml' file in the same directory as 
the web.xml one, in this this file you can use the following parameter
 
  
URLRewritingEnabled    
false 
 
in the  section
Here is the link for the documentation of this Xml file.
 
http://e-docs.bea.com/wls/docs60/programming/weblogic_xml.html
 
As I said, this solution does not really solve the problem but is a 
workaround.
 
I already post the problem in the Weblogic newsgroup, but no answer yet, as 
soon as I receive a real solution I will let you know.
 
Thierry
 
 
Thierry Cools Senior Java Developer S1 Brussels 
Kleine Kloosterstraat, 23 1932 st. Stevens-Woluwe Belgium Tel : 
+32 2 200 43 82 Email : [EMAIL PROTECTED] 

  - Original Message - 
  From: 
  Zhiyong Li 
  To: [EMAIL PROTECTED] 
  
  Sent: Thursday, January 11, 2001 7:11 
  PM
  Subject: RE: Strange problem using 
  Weblogic 6.0
  I had the same problem. Is there a work around from either 
  Struts orWebLogic (any WebLogic people out there)?Thx,Zhiyong 
  -Original Message-From: Craig R. McClanahan 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, January 11, 2001 1:03 
  PMTo: [EMAIL PROTECTED]Subject: 
  Re: Strange problem using Weblogic 6.0Thierry Cools 
  wrote:>  Hi Craig, Thanks for your explanations, but the 
  problem is different,maybe I> was not very clear in my first mail. 
  The problem is that, as you cansee in> the adress link, Weblogic 
  add '/' characters in the jsessionid and theservlet> engine doesn't 
  seems to be able to recognize that the session id isnot a part> of 
  the context path, so that the context path contains the realcontext path 
  +> the session id, the result of this is that the application can 
  notaccess all> following links because of this. I hope it was more 
  clear this time.Thanks> for your help,Thierry> Thierry 
  CoolsThis looks like a bug in the way WebLogic is doing URL 
  rewriting.The session id is required (by the servlet spec) to be 
  passed as a*path*parameter, not a *query* parameter.  According 
  to the RFC for URL syntax(Ibelieve it's 2396, but don't have it 
  available at the moment to check),theoverall syntax goes like 
  this:    
  scheme://host:port/resource-path;path-parameters?query-parametersin 
  other words, if I start with a URL like this:    http://myhost/myapp/logon.do?name=valueI 
  should end up with a URL like this:    http://myhost/myapp/logon.do;jsessionid=12345?name=value(which 
  is what Tomcat and every other container I've tested does).  Itlooks 
  tome like Weblogic is sticking the session id before the "/logon.do" 
  part,whichbasically screws up the resource-path part of your 
  URL.Craig


Directions of digester?

2001-01-11 Thread Lenz, Georg

Hei 

what are the directions of digester?
Right now I am using digester as nice little XML2Objects 
(parse XML and create a hierarchical object model) tool in a non struts
context. 
For the first simple steps it is nice but the definition of the even
triggering is a little bit 
restricted. 
Is that going to be enhanced in directions of XPath?

Best regards

Georg Lenz






Re[4]: Properties in ActionForms

2001-01-11 Thread Oleg V Alexeev

Hello Martin,

With your example -


  
  

 

Global error message -


  


All fields (without errorMessage) such as it -

will be processed with message from list global messages.

Type -

 
 


Global error message for casting -

  
  


All conversion operations with number properties will use global
message to generate error message in case of wrong conversion.


Friday, January 12, 2001, 7:54:44 AM, you wrote:

MC> Oleg,

MC> You mentioned four additions:

MC> - type
MC> - global error message for missing properties
MC> - error message for conversion error with property
MC> - global error message for properties of some type

MC> I understand the first one (type). There, I was just being lazy, since all
MC> my properties are Strings. :-)

MC> Can you help me understand what you mean by the other three?

MC> Thanks!

MC> --
MC> Martin Cooper
MC> Tumbleweed Communications

MC> - Original Message -
MC> From: "Oleg V Alexeev" <[EMAIL PROTECTED]>
MC> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
MC> Sent: Thursday, January 11, 2001 1:31 PM
MC> Subject: Re[2]: Properties in ActionForms


>> Hello martin,
>>
>> Thursday, January 11, 2001, 10:50:00 PM, you wrote:
>>
>> mctc> Something I am working on at the moment is a very simple utility
MC> that
>> mctc> generates a form bean from an XML definition. The goal is simply to
MC> reduce
>> mctc> typing in generating beans - as Roger mentioned, it is kinda
MC> tedious. I'm
>> mctc> using something like this to specify a bean:
>>
>> mctc> 
>> mctc>
>> mctc>> mctc> errorMessage="error.city.required"/>
>> mctc> errorMessage="error.zip.required"/>
>> mctc> 
>>
>> mctc> Pretty simplistic stuff, but it meets my needs right now. If this
MC> would be
>> mctc> of interest to people (and if my company allows it), I can make it
>> mctc> available when I'm done.
>>
>> mctc> Also, if people have ideas on what it might do differently, or what
MC> else it
>> mctc> might do, I'd be interested in hearing them. And if anyone has a
MC> copy of
>> mctc> the messages from Mark Wutka mentioned in the Struts 1.1 TODO list,
MC> I'd
>> mctc> appreciate it if they could forward them to me.
>>
>> Good idea. I think global errorMessage for missing properties can be
>> defined. And add type as attribute for property. And add errorMessage
>> for convertion error with property. And add global errorMessage for
>> properties of some type 8)
>>
>> --
>> Best regards,
>>  Olegmailto:[EMAIL PROTECTED]
>>
>>





-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Re[2]: Properties in ActionForms

2001-01-11 Thread Martin Cooper

Oleg,

You mentioned four additions:

- type
- global error message for missing properties
- error message for conversion error with property
- global error message for properties of some type

I understand the first one (type). There, I was just being lazy, since all
my properties are Strings. :-)

Can you help me understand what you mean by the other three?

Thanks!

--
Martin Cooper
Tumbleweed Communications

- Original Message -
From: "Oleg V Alexeev" <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 1:31 PM
Subject: Re[2]: Properties in ActionForms


> Hello martin,
>
> Thursday, January 11, 2001, 10:50:00 PM, you wrote:
>
> mctc> Something I am working on at the moment is a very simple utility
that
> mctc> generates a form bean from an XML definition. The goal is simply to
reduce
> mctc> typing in generating beans - as Roger mentioned, it is kinda
tedious. I'm
> mctc> using something like this to specify a bean:
>
> mctc> 
> mctc>
> mctc> mctc> errorMessage="error.city.required"/>
> mctc>
> mctc> 
>
> mctc> Pretty simplistic stuff, but it meets my needs right now. If this
would be
> mctc> of interest to people (and if my company allows it), I can make it
> mctc> available when I'm done.
>
> mctc> Also, if people have ideas on what it might do differently, or what
else it
> mctc> might do, I'd be interested in hearing them. And if anyone has a
copy of
> mctc> the messages from Mark Wutka mentioned in the Struts 1.1 TODO list,
I'd
> mctc> appreciate it if they could forward them to me.
>
> Good idea. I think global errorMessage for missing properties can be
> defined. And add type as attribute for property. And add errorMessage
> for convertion error with property. And add global errorMessage for
> properties of some type 8)
>
> --
> Best regards,
>  Olegmailto:[EMAIL PROTECTED]
>
>





Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread JamesW


This is a very interesting discussion; this sort of functionality appears
to be missing from all of the servlet based frameworks out there (with
possibly the exception of Hammock?).

An example of what I would like struts to be able to support (and this
example may have already been put forward, but here's my take on it anyway)
is a screen (okay, 'form') that has multiple fields, plus say a customer
field. You can either enter the name of the customer, or click on a link
next to the field called 'Find Customer...'. This takes you to the 'Find
Customer' form where you can enter search parameters and then see a list of
customers matching those parameters (the 'Customer List' form). The 'List
Customer' form may let you return to the 'Find Customer' form for another
type of search, or click on a link next to one of the matching customers.
This should return you to the first screen, with all of the values entered
up to that point intact (okay, so that means its not a link but a form
post), PLUS the value of the customer field. The 'Find Customer' screen
should be able to be invoked from a range of other screens.

I guess that perhaps this could be done by an application in Struts quite
easily, but some standard approach enforced by the framework itself would
be nice.

Regards,
James W.

--
This e-mail is from Cards Etc Pty Ltd (ACN: 069 533 302). It may contain
privileged and confidential information. It is intended for the named
recipient(s) only. If you are not an intended recipient, please notify us
immediately by reply e-mail or by phone on +61 2 9212 7773 & delete this
e-mail from your system.
--





Container doesn't seem to allow *.do

2001-01-11 Thread Lou . Farho

It looks like iPlanet 6.0sp1 does not allow the servlet mapping of *.do.
How can I work around this?

Lou Farho
Sr. Engineer
Level (3) Communications, Inc.
720-888-7751




Re: How to populate forms the first time around?

2001-01-11 Thread Craig R. McClanahan

"Felciano, Ramon" wrote:

> Hi Craig --
>
> OK, I'm definitely missing something. I thought there was a pretty tight
> coupling between HTML forms and ActionForm objects,

Yes ... the field names on the form correspond to the property names in the
bean.

> and that ActionForm
> objects could (should) only be used on the page that contained the form and
> the subsequent Action class.
>

I would add "and possibly preceding action classes" as well, with the use case
discussed in the previous message as the justification.

>
> Instead, it appears that ActionForms are universally accessible server-side
> mirrors of form data structure. Is this true? Can a particular ActionForm
> for a given form on the site can be accessed from other pages?

Not from other pages (unless they happen to use the same form, which will happen
occasionally -- consider a little mini-search-engine that you use on lots of
different pages).

The key to understanding is to recall how the  tag works -- it only
creates a new bean *if* there is not one there already.  The  tag
works the same way -- it will create a new ActionForm instance for you if need
be, but it will happily use an existing one that is already present.  And, in
the case of the example application, I take advantage of this (plus the
pre-population of the form that is done in the edit regstration action) to
create a user experience similar to the way that GUI programs work.

The beauty of this style is that the presentation page doesn't have to care how
the bean got there, or even *if* it was there already.  It only cares about how
to make the page look pretty.

> Or is the
> preferred approach to use Struts logic tags to re-purpose a single JSP page
> as multiple pages (e.g. the registration.jsp page which serves to Create,
> Edit and Delete registrations)?

For a typical "file maintenance" sort of application, I tend to re-use the same
page for all three transactions.  They are distinguished in the Struts example
app by the "action" request parameter.

> How do you deal with read-only displays
> (e.g. a confirm-subscription.jsp page that doesn't have a form per se but
> displays the just-registered subscription settings)?
>

As long as the "action" parameter is passed back and forth, both the page and
the action can figure out how to handle the variations.

For example, consider the subscription.jsp page in the example app.  No matter
what action you requested, it displays the same basic set of fields.  However,
you'll note that it displays a "Confirm" button rather than a "Save" button when
you are deleting -- in the JSP page, you'll see that I'm using 
tests to decide what button label should be presented, based on the value of the
"action" parameter.

Likewise, consider the SaveSubscriptionAction that is invoked -- no matter which
transaction you are executing.  Because the value of "action" is included as a
property in my ActionForm, and as a hidden field (see the  just under ) on the page, the save action can
decide to do an INSERT, UPDATE, or DELETE based on whether the action says
"Create", "Edit", or "Delete".

This is not the only way to arrange pages and actions, but I tend to be
constructively lazy :-).  I would rather make a single page (and two actions --
EditSubscriptionAction and SaveSubscriptionAction) a little bit more complicated
rather than have three simple pages (and six simple actions) that are almost,
but not quite, identical.

>

>
> Thanks for the quick response(s).
>

Ironically, I'm spending most of the day running test suites against Tomcat 4.0,
so I've had more time than usual to answer mail.  It's also nice to get
discussions like this published on the mailing list, so that others can benefit
as well.

>
> Ramon
>

Craig





Re: Can I use a Map.Entry as a bean?

2001-01-11 Thread martin . cooper

At 09:57 AM 1/11/01 -0800, you wrote:
>Chris Wilson wrote:
>
> > > From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> > [snip]
> > > One interesting point that I discovered on my trails through the code is
> > > that the "type" attribute on the logic:iterate tag does not appear to be
> > > used at all. It certainly isn't taken into account when
> > > bean:write is doing
> > > its thing. This actually makes sense when you think about it - the
> > > logic:iterate tag just puts a bean into the requested scope, and
> > > it's up to
> > > the retriever (in this case, bean:write) to decide what type it is.
> >
> > why is the type attribute even in the iterate tag then?  just curious...
> >
>
>Check out the org.apache.struts.taglib.logic.IterateTei class -- you will see
>that the "type" attribute is used to define the Java data type of the 
>scripting
>variable that is exposed to the page.  This does not generally matter if you
>only access the exposed bean with custom tags, but does matter if you try to
>access it with scriptlets -- the default data type is java.lang.Object, so you
>would have to cast all your method calls.
>
>The same general pattern is followed in other places where the "type" 
>attribute
>is used for the same purpose, such as .
>
>Craig

Ah, the TEI is one of the pieces of custom tags that I'm not up on quite 
yet. I was looking for code that called getType() or setType(), and I 
couldn't find any, which is how I came to my (incorrect) conclusion. It did 
seem odd that the field would be there but not used at all. ;-)

--
Martin Cooper
Tumbleweed Communications





RE: How to populate forms the first time around?

2001-01-11 Thread Felciano, Ramon


Hi Craig --

OK, I'm definitely missing something. I thought there was a pretty tight
coupling between HTML forms and ActionForm objects, and that ActionForm
objects could (should) only be used on the page that contained the form and
the subsequent Action class.

Instead, it appears that ActionForms are universally accessible server-side
mirrors of form data structure. Is this true? Can a particular ActionForm
for a given form on the site can be accessed from other pages? Or is the
preferred approach to use Struts logic tags to re-purpose a single JSP page
as multiple pages (e.g. the registration.jsp page which serves to Create,
Edit and Delete registrations)? How do you deal with read-only displays
(e.g. a confirm-subscription.jsp page that doesn't have a form per se but
displays the just-registered subscription settings)?

Thanks for the quick response(s).

Ramon

> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 4:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: How to populate forms the first time around?
> 
> 
> "Felciano, Ramon" wrote:
> 
> > Hi --
> >
> > I'm still trying to understand the basic Struts data flow 
> model. I think I
> > understand how ActionForms can be tied to a particular HTML 
> form via the
> > form/bean name, and how to use Struts tags to repopulate a 
> form with the
> > last-entered values. But what about the first time the form appears?
> > Assuming this is the first time the user has viewed this 
> form, does an
> > ActionForm object exist for that form yet?
> >
> > For example, if you have a UserPreferences bean, you can 
> either populate the
> > form from that bean, which presumeably represents that 
> last-saved user
> > preference data, or from the ActionForm bean, which holds the
> > last-entered-but-possibly-not-saved user preference data. 
> How do you choose?
> >
> 
> The pattern I normally follow is illustrated in the Struts 
> example application.
> Consider the case that you are on the registration.jsp page, 
> and you want to
> create a new subscription.
> 
> The hyperlink for "Create" does *not* go directly to a JSP 
> page -- instead, it
> goes to an action in the controller servlet 
> (/editSubscription.do?action=Create)
> that prepopulates the (empty) ActionForm the first time, 
> before proceeding to
> "subscription.jsp" to display it.
> 
> Likewise, clicking one of the subscription edit links takes you to
> 
> /editSubscription.do?action=Edit&username=xxx&host=yyy
> 
> (where "xxx" and "yyy" represent the primary keys of the 
> subscription to be
> edited).  This time, the edit subscription action populates 
> the ActionForm with
> the contents of the current subscription, before proceeding to
> "subscription.jsp" to display it.
> 
> The "subscription.jsp" page itself finds that the bean is 
> already present, so it does not create a new one.
> 
So is the "struts way" of doing this to display an error if the bean doesn't
in fact exist (e.g. we jumped straight to the JSP page rather than go
through the Actions)?

Ramon



Re: How to populate forms the first time around?

2001-01-11 Thread Craig R. McClanahan

"Felciano, Ramon" wrote:

> Hi --
>
> I'm still trying to understand the basic Struts data flow model. I think I
> understand how ActionForms can be tied to a particular HTML form via the
> form/bean name, and how to use Struts tags to repopulate a form with the
> last-entered values. But what about the first time the form appears?
> Assuming this is the first time the user has viewed this form, does an
> ActionForm object exist for that form yet?
>
> For example, if you have a UserPreferences bean, you can either populate the
> form from that bean, which presumeably represents that last-saved user
> preference data, or from the ActionForm bean, which holds the
> last-entered-but-possibly-not-saved user preference data. How do you choose?
>

The pattern I normally follow is illustrated in the Struts example application.
Consider the case that you are on the registration.jsp page, and you want to
create a new subscription.

The hyperlink for "Create" does *not* go directly to a JSP page -- instead, it
goes to an action in the controller servlet (/editSubscription.do?action=Create)
that prepopulates the (empty) ActionForm the first time, before proceeding to
"subscription.jsp" to display it.

Likewise, clicking one of the subscription edit links takes you to

/editSubscription.do?action=Edit&username=xxx&host=yyy

(where "xxx" and "yyy" represent the primary keys of the subscription to be
edited).  This time, the edit subscription action populates the ActionForm with
the contents of the current subscription, before proceeding to
"subscription.jsp" to display it.

The "subscription.jsp" page itself finds that the bean is already present, so it
does not create a new one.

The basic philosophy is to direct yourselves through an appropriate action to
set things up, and then use a different action (/saveSubscription.do) to process
the input.

>
> Thanks!
>
> Ramon

Craig McClanahan





How to populate forms the first time around?

2001-01-11 Thread Felciano, Ramon


Hi --

I'm still trying to understand the basic Struts data flow model. I think I
understand how ActionForms can be tied to a particular HTML form via the
form/bean name, and how to use Struts tags to repopulate a form with the
last-entered values. But what about the first time the form appears?
Assuming this is the first time the user has viewed this form, does an
ActionForm object exist for that form yet?

For example, if you have a UserPreferences bean, you can either populate the
form from that bean, which presumeably represents that last-saved user
preference data, or from the ActionForm bean, which holds the
last-entered-but-possibly-not-saved user preference data. How do you choose?

Thanks!

Ramon

_

Ramon M. Felciano
INGENUITY Systems, Inc.





Re: problem using struts taglibs on jrun

2001-01-11 Thread Craig R. McClanahan

Chris Wilson wrote:

> hello,
>
> i've run into a snag using the  tag in jrun 3.0 sp1.
>
> when i set the ignore attribute to true i get a servlet error from jrun that
> there's no method matching setIgnore(java.lang.String) in the write tag.
>
> so i looked at the source of the servlet that jrun compiled from my jsp, and
> sure enough, it had a call like this: tag.setIgnore("true");
>
> of course this fails since the method signature of setIgnore takes a native
> boolean.
>
> when i run the same page on tomcat, jasper compiles the same thing to:
> tag.setIgnore(true); which is correct (at least it works!).
>

Yep ... this is correct.

>
> which compiler is right by the spec? tomcat or jrun?  it looks like tomcat
> is introspecting the tag to see what the method signature is, and doing the
> "true" -> true translation for me.
>
> i'm just curious if the jrun compiler is just lazy, or if the struts tags
> have been written to take advantage of some tomcat "magic" that seems to be
> affecting their portability?
>

In JSP 1.1, the set of type conversions that a JSP page compiler does for a
 tag are identified in Table 2.4, on page 65.  In particular,
if the property is boolean, the compiler converts the string value you specify
to a boolean, according to the rules of the java.lang.Boolean.valueOf(String)
method.

The spec was not originally clear that these rules applied to custom tags as
well -- however, this was clarified in "Issue 7" of the JSP 1.1 Errata published
at:

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

and is more clearly spelled out in the JSP 1.2 Proposed Final Draft.

It is definitely not Tomcat "magic" :-), any more than the conversion for
integer, long, float, or double attributes would be.

>
> forgive me if this topic has been discussed before, i forgot where the
> archive was, and wasn't able to search for this issue.
>

I don't believe this one has been addressed on STRUTS-USER, although I think
I've seen it a couple of other places.

>
> thanks for any insight.
>
> cheerio,
> chris
>
> | chris wilson || web dev ||| [EMAIL PROTECTED] || | www.wondergeek.com |
> |

Craig





problem using struts taglibs on jrun

2001-01-11 Thread Chris Wilson

hello,

i've run into a snag using the  tag in jrun 3.0 sp1.

when i set the ignore attribute to true i get a servlet error from jrun that
there's no method matching setIgnore(java.lang.String) in the write tag.

so i looked at the source of the servlet that jrun compiled from my jsp, and
sure enough, it had a call like this: tag.setIgnore("true");

of course this fails since the method signature of setIgnore takes a native
boolean.

when i run the same page on tomcat, jasper compiles the same thing to:
tag.setIgnore(true); which is correct (at least it works!).

which compiler is right by the spec? tomcat or jrun?  it looks like tomcat
is introspecting the tag to see what the method signature is, and doing the
"true" -> true translation for me.

i'm just curious if the jrun compiler is just lazy, or if the struts tags
have been written to take advantage of some tomcat "magic" that seems to be
affecting their portability?

forgive me if this topic has been discussed before, i forgot where the
archive was, and wasn't able to search for this issue.

thanks for any insight.

cheerio,
chris

| chris wilson || web dev ||| [EMAIL PROTECTED] || | www.wondergeek.com |
|




Re: Documentation in nightly source distribution.

2001-01-11 Thread Craig R. McClanahan

Eric Wu wrote:

> I tried this with the January 10 build but when I click on the User's Guide
> (1.0) link, I get a blank page.
>
> Is this an issue with the build or my app server (JRun 3.0)
>

For a variety of reasons, the generated documentation has not been correct in
the last few nights's distributions.  This was corrected this morning -- since
this WAR file is also the contents of the Struts web site, I've just updated it
there.  You can see the most recent version (as of 10:15 this morning Pacific
time) at:

http://jakarta.apache.org/struts

>
> Eric
>

Craig





RE: Documentation in nightly source distribution.

2001-01-11 Thread Eric Wu

I tried this with the January 10 build but when I click on the User's Guide
(1.0) link, I get a blank page.

Is this an issue with the build or my app server (JRun 3.0)

Eric

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: January 11, 2001 4:53 PM
To: [EMAIL PROTECTED]
Subject: Re: Documentation in nightly source distribution.


The simplest way would be to run the struts-documentation web app in the 
distribution, and access the documentation that way.

--
Martin Cooper
Tumbleweed Communications


At 02:41 PM 1/11/01 -0700, you wrote:
>There is a src/doc dir which contains the documentation in xml format. Is
>there an easy way to generate html from these xml files?




Struts Example, error using

2001-01-11 Thread Joseph Terranova

Hello,

I'm using the 20010105 build of Struts running under JRun v3.00.3694 and cannot run 
the web
example code...

Here's the error I receive:

500 Internal Server Error
/struts-example/:

javax.servlet.ServletException: Compilation error occured: 
 
allaire.jrun.scripting.DefaultCFE: 
Errors reported by compiler:C:/Program
Files/Allaire/JRun/servers/default/struts-example/WEB-INF/jsp/jrun__index2ejspa.java:44:1:44:27:
Error: No match was found for method "setLocale(java.lang.String)".

at 
allaire.jrun.scripting.JavaCompilerService.compile(JavaCompilerService.java:122)
at allaire.jrun.jsp.JSPServlet.compilePage(JSPServlet.java:452)
at allaire.jrun.jsp.JSPServlet.createServlet(JSPServlet.java:393)
at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:201)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:168)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at 
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.file.FileServlet.service(FileServlet.java:144)
at allaire.jrun.servlet.JRunServletPool.service(JRunServletPool.java:83)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at 
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:354)
at allaire.jrun.ThreadPool.run(ThreadPool.java:267)
at allaire.jrun.WorkerThread.run(WorkerThread.java:74)

Here's what the line of code looks like in jrun__index2ejspa.java:
html__6_1.setLocale("true");

The setLocale method is defined in the HtmlTag tag handler as:
public void setLocale(boolean locale) {
this.locale = locale;
}

If I change the tag in index.jsp from

to


I receive the same error, but the line of code in jrun__index2ejspa.java now looks 
like this:
html__6_1.setLocale("ttruet");

If I change the tag in index.jsp to

the page loads without error...

So, setLocale expects a boolean but a string is being passed in.  Thoughts?  Input is 
greatly
appreciated!

Joe





__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/



Re: Documentation in nightly source distribution.

2001-01-11 Thread Ted Husted

Running 

build dist

or 

./build.sh dist

from the folder where you unpacked it should do it, if all the
prerequesites are installed.

See < http://jakarta.apache.org/struts/installation.html#Building >

*** REPLY SEPARATOR  ***

On 1/11/2001 at 2:41 PM Walter Holladay wrote:

There is a src/doc dir which contains the documentation in xml format.
Is
there an easy way to generate html from these xml files?






Re: Documentation in nightly source distribution.

2001-01-11 Thread martin . cooper

The simplest way would be to run the struts-documentation web app in the 
distribution, and access the documentation that way.

--
Martin Cooper
Tumbleweed Communications


At 02:41 PM 1/11/01 -0700, you wrote:
>There is a src/doc dir which contains the documentation in xml format. Is
>there an easy way to generate html from these xml files?





Re: Sorry that was ErrorTag.java

2001-01-11 Thread Craig R. McClanahan

[EMAIL PROTECTED] wrote:

> The date stamp on the file is 01/02/01 and is from the Windows source.
> I also got the build from 
>
> It looks like from the previous binary build that this file no longer
> exists.
> Was this documented somewhere?
>
> Also, the binary from   looks pretty small 267k
> !
>

Last night's binary build was broken due to syntax errors in some of the new
documentation files.  Should be fixed tonight.

Also, there is no file ErrorTag anywhere in Struts.  There is an ErrorsTag file,
in two (now, used to be three) places:  org.apache.struts.taglib and
org.apache.struts.taglib.html.  The third place it used to be was in
org.apache.struts.taglib.form -- this entire package has been removed, because
all of the corresponding classes were placed in org.apache.struts.taglib.html
instead.

Which version of the file were you concerned with?

>
> Lou Farho
> Sr. Engineer
> Level (3) Communications, Inc.
> 720-888-7751

Craig



Documentation in nightly source distribution.

2001-01-11 Thread Walter Holladay

There is a src/doc dir which contains the documentation in xml format. Is
there an easy way to generate html from these xml files?




Re[2]: Properties in ActionForms

2001-01-11 Thread Oleg V Alexeev

Hello martin,

Thursday, January 11, 2001, 10:50:00 PM, you wrote:

mctc> Something I am working on at the moment is a very simple utility that 
mctc> generates a form bean from an XML definition. The goal is simply to reduce 
mctc> typing in generating beans - as Roger mentioned, it is kinda tedious. I'm 
mctc> using something like this to specify a bean:

mctc> 
mctc>
mctc> errorMessage="error.city.required"/>
mctc>
mctc> 

mctc> Pretty simplistic stuff, but it meets my needs right now. If this would be 
mctc> of interest to people (and if my company allows it), I can make it 
mctc> available when I'm done.

mctc> Also, if people have ideas on what it might do differently, or what else it 
mctc> might do, I'd be interested in hearing them. And if anyone has a copy of 
mctc> the messages from Mark Wutka mentioned in the Struts 1.1 TODO list, I'd 
mctc> appreciate it if they could forward them to me.

Good idea. I think global errorMessage for missing properties can be
defined. And add type as attribute for property. And add errorMessage
for convertion error with property. And add global errorMessage for
properties of some type 8)

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Sorry that was ErrorTag.java

2001-01-11 Thread Ted Husted

The build for 11-JAN failed due to an error in one of the XML files
(mea culpa). 

*** REPLY SEPARATOR  ***

On 1/11/2001 at 2:03 PM [EMAIL PROTECTED] wrote:

The date stamp on the file is 01/02/01 and is from the Windows source.
I also got the build from  

It looks like from the previous binary build that this file no longer
exists.
Was this documented somewhere?

Also, the binary from   looks pretty small
267k
!

Lou Farho
Sr. Engineer
Level (3) Communications, Inc.
720-888-7751






Re:unsubscribe

2001-01-11 Thread Govindarajan S

unsubscribe




Sorry that was ErrorTag.java

2001-01-11 Thread Lou . Farho

The date stamp on the file is 01/02/01 and is from the Windows source.
I also got the build from  

It looks like from the previous binary build that this file no longer
exists.
Was this documented somewhere?

Also, the binary from   looks pretty small 267k
!

Lou Farho
Sr. Engineer
Level (3) Communications, Inc.
720-888-7751




Re[2]: Properties in ActionForms

2001-01-11 Thread Oleg V Alexeev

Hello Craig,

Thursday, January 11, 2001, 9:46:45 PM, you wrote:

CRM> We're talking futures in terms of Struts here, but my question is ... aren't you
CRM> doing the Locale-specific conversion a little bit too early?

CRM> My thinking is that business logic objects maintain data objects in a
CRM> Locale-insensitive format (like java.util.GregorianCalendar or
CRM> java.math.BigDecimal).  And, the ActionForm properties would be of the same
CRM> type.  Conversion to or from String would happen at the last minute -- just as
CRM> you prepare the page for display, or as you are accepting the input.

CRM> Admittedly, we need better support in Struts (such as your formatting version of
CRM> , and a way to process the input string with PropertyEditor type
CRM> classes) to make this strategy really effective, but I would suggest not doing
CRM> the Locale-specific formatting until you have to.

We start work at struts 0.5 stage and found some troubles with
non-String properties for Form beans. Because of it I break classes to
the groups: 1-form beans (String only properties) and 2-data beans
(with such types of properties as Integer, Date, etc.). Action class
fills form bean with values from data bean and make locale specific
conversion at this stage. User fills form with new values and submit
it to the save action. Save action takes String values from form and
make conversion to the internal representation (Integer, Date, etc.)
There are two variants to perform conversion to/from form beans -
place all logic in set/get methods in form or incorporate
import/export methods to the form beans and call it on phase of init
or submit. But locale specific conversion needs to be performed with
current locale and value of current locale must be retrieved every
set/get calling. And because of it I make import/export methods, where
is place to perform all locale specific operations - retrieve locale,
retrieve format beans, convert values to/from String.
For my mind it is most effective way to perform tranlation, but I
don't like this scheme... Can you pass some words about another
solution, if you have one?

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Bad Error.java file in src

2001-01-11 Thread Lou . Farho

Howdy,
I just got last nights source.  The Error.java file is missing the package
declaration and the Struts standard header.

Lou Farho
Sr. Engineer
Level (3) Communications, Inc.
720-888-7751




Re: Newbie question on templates

2001-01-11 Thread Warren Strange


Thanks Cedric,

This confirms what I thought was happening.

It seems cumbersome to me to have a one to one mapping between my
content and my layout. If I have one layout that I am happy with for
my entire site (e.g. standard header, footer, sidebar - which may
dynamically
change their appearance based on current session state) - it would be
nice if I could tell the struts framework "when processing my content -
always
process these standard JSPs (e..g header.jsp, footer.jsp) for me and then
insert
the current content page. Why should I have to specify the same template
over
and over again ( the only difference between each template file is the
content="foo.html"  entry).

Of course you would need a way to override this default behaviour if you
wanted to layout
a page with a different template.

The analogy that comes to mind is telling your word processor to always
apply the same
master page (header, footer, etc.) to your content. The page numbers, etc.
may change
dynamically - but the structure is always the same.

Can this be done in struts? I am guessing one could write a dispatcher
servlet that
would have this kind of behaviour - but I am not sure how that would be
accomplished
in struts.


Thanks


Warren



- Original Message -
From: "Cedric Dumoulin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 6:53 AM
Subject: Re: Newbie question on templates


>
>   Hi Warren,
>
>   In the Struts Template example, you define one template
> (chapterTemplate.jsp) common to all your web pages.
>   Then, you define one jsp file for each of your web page that use the
> template (introduction.jsp, optional.jsp, ...). In each jsp file you
specify
> template argument values (header, body, ...). If you want web pages with
> common part (ex : sidebar), define another template fixing this property
> value. This template could possibly use the more general template.
>
>   You can also have a look to my Component proposal
> (http://gauss.ficsgrp.com/cdm). This can be seem as an extended template
> library. It provides all Struts Template functionalities (with same
syntax),
> plus new useful functionalities to develop reusable 'web components'.
>   I have rewrite the struts-template example using the Components. Chek it
!
>   Any comments are welcome to improve this Component library.
>
>   Cedric
>
> Warren Strange wrote:
>
> > Hi,
> >
> > I am just get started with struts, and have a question on templates.
> >
> > >From the example given (templates-example) , it appears that you need
a
> > template file
> > for each content JSP that you want to lay out using the template. For
> > example:
> >
> > introduction.html  (the content), and introduction.jsp (the template
> > reference)
> >
> > optional.html (the content)  and optional.jsp (the template reference)
> >
> > and so on
> >
> > This approach seems rather cumbersome to me. If you want to change the
> > template
> > you might have go back and edit all the template reference files (e.g.
say
> > you add
> > 'rightSideBar'  content, or something like that).
> >
> > I want to define one common template (which includes standard headers,
> > footer,
> > etc. - possibly changing their behavior dynamically) and have it applied
> > automatically
> >  to all my content.
> >
> > How is done?
> >
> > Thanks
> >
> > Warren
>
>




Re: Properties in ActionForms

2001-01-11 Thread martin . cooper

Something I am working on at the moment is a very simple utility that 
generates a form bean from an XML definition. The goal is simply to reduce 
typing in generating beans - as Roger mentioned, it is kinda tedious. I'm 
using something like this to specify a bean:


   
   
   


Pretty simplistic stuff, but it meets my needs right now. If this would be 
of interest to people (and if my company allows it), I can make it 
available when I'm done.

Also, if people have ideas on what it might do differently, or what else it 
might do, I'd be interested in hearing them. And if anyone has a copy of 
the messages from Mark Wutka mentioned in the Struts 1.1 TODO list, I'd 
appreciate it if they could forward them to me.

Thanks!

--
Martin Cooper
Tumbleweed Communications


At 10:12 AM 1/11/01 -0800, you wrote:
>Roger Kjensrud wrote:
>
> > Hello,
> >
> > I wonder if any of you have implemented an automatic way of populating the
> > properties in the ActionForm? It's kind of tedious to write all these 
> setter
> > and getter methods
> >
>
>For generating the code of a form bean automatically, that is something I want
>to look at in the 1.1 time frame.  As well, we need to look at use cases where
>you do not know the property names ahead of time, and need them to work 
>totally
>dynamically.
>
>For populating the properties, if you are trying to copy things from a 
>"business
>logic" bean that has the same property names, consider the
>PropertyUtils.copyProperties() method.
>
> >
> > I found an
> > article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html)
> > describing one way of doing this, and I would be interested in hearing some
> > feedback on doing it that way.
> >
> > Thanks,
> > Roger Kjensrud
>
>Craig McClanahan





Re: struts:errors

2001-01-11 Thread John Hunt


> 
> However ... (dramatic pause) ... using the most
> recent build, you can
> now  use simple/nested/indexed expressions like
> this:
>   
>   
>   
> and the appropriate processing will be applied to
> get the street
> address (for initial display) and set the street
> address (when the form
> is processed).
>
I here normally people saying they are getting build
errors. Are there jar files which I can download
instead of going through the build process??

> Your validation method would then queue up whatever
> error messages
> should be communicated to the user, and display them
> all on your input
> form. (ActionErrors is a collection.)

As I said if there are two ActionForms in a html page
and thus two action classes to handle. So depending on
the request the corresponding action class is executed
and if it returns an ActionError, all 
does is display the error message. But I want it like
if the ActionError has been generated by Action1 class
display it in section 1 of the html page and if it is
2 then in second section. Does this mean that I can
have  at two places??? Which I dont
think so because it would display the message twice. 
-- How in a JSP file I can distinguish between errors
returned by different Action classes - is my question?



__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/



Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread Ted Husted

"Felciano, Ramon" wrote:
> - Confirm pages ("Are you sure that ?" with "Continue" and
"Cancel"
> buttons)
> - Pick lists ("We couldn't find the product ID you entered; please
select
> from the following list")
> - Alert pages for (possibly unexpected) server-side events that
occured
> since the last client-server traffic passed through.

Just a wild idea here: 

An action is not required to forward to a path or action, but has
everything it needs to answer the request itself (and return a null
action forwarding).

So how about if the action wrote pages like this dynamically, the
old-fashioned servlet way, perhaps using a standard "message box" type
library? 

The responses in the dynamic page could then be set to forward to
whatever actions or paths were appropriate to the circumstances,
without having to write a physical JSP for every conceivable
combination.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/





Re: Properties in ActionForms

2001-01-11 Thread Craig R. McClanahan

Oleg V Alexeev wrote:

> Hello Ted,
>
> In my application I use import/export methods in Form classes. For the
> first time I try to use PropertyUtils.copyProperties(), but this
> method convert properties without locale choosing. I need to process
> different time/date and number formats for different languages.
> Because of it I use my own methods to convert values to String and
> from String to values.
> I think that locale must be used to convert values in
> PropertyUtils.copyProperties() and in  tag.
> If anybody can suggest another way, plesase, I am very interested in
> it.
>

We're talking futures in terms of Struts here, but my question is ... aren't you
doing the Locale-specific conversion a little bit too early?

My thinking is that business logic objects maintain data objects in a
Locale-insensitive format (like java.util.GregorianCalendar or
java.math.BigDecimal).  And, the ActionForm properties would be of the same
type.  Conversion to or from String would happen at the last minute -- just as
you prepare the page for display, or as you are accepting the input.

Admittedly, we need better support in Struts (such as your formatting version of
, and a way to process the input string with PropertyEditor type
classes) to make this strategy really effective, but I would suggest not doing
the Locale-specific formatting until you have to.

Craig





Re: Properties in ActionForms

2001-01-11 Thread Ted Husted

>I wonder if any of you have implemented an automatic way of populating
the properties in the ActionForm? 

Doing more with "auto beans" is being discussed for the 1.1 timefreame.
Meanwhile, the latest builds support the next best thing: You can
define generic data beans for your business logic data, and then make
these instance variables on your action forms. The HTML form tags now
support a nested syntax like this:
  
  
  
and the appropriate processing will be applied to get the street
address (for initial display) and set the street address (when the form
is processed).

Of course, you still have to define the accessor and mutators for your
generic data beans, but it's a step in the right direction!

*** REPLY SEPARATOR  ***

On 1/11/2001 at 9:39 AM Roger Kjensrud wrote:

Hello,

I wonder if any of you have implemented an automatic way of populating
the
properties in the ActionForm? It's kind of tedious to write all these
setter
and getter methods

I found an
article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.htm
l)
describing one way of doing this, and I would be interested in hearing
some
feedback on doing it that way.

Thanks,
Roger Kjensrud






RE: Strange problem using Weblogic 6.0

2001-01-11 Thread Zhiyong Li

I had the same problem. Is there a work around from either Struts or
WebLogic (any WebLogic people out there)?

Thx,
Zhiyong 


-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 1:03 PM
To: [EMAIL PROTECTED]
Subject: Re: Strange problem using Weblogic 6.0


Thierry Cools wrote:

>  Hi Craig, Thanks for your explanations, but the problem is different,
maybe I
> was not very clear in my first mail. The problem is that, as you can
see in
> the adress link, Weblogic add '/' characters in the jsessionid and the
servlet
> engine doesn't seems to be able to recognize that the session id is
not a part
> of the context path, so that the context path contains the real
context path +
> the session id, the result of this is that the application can not
access all
> following links because of this. I hope it was more clear this time.
Thanks
> for your help,Thierry
> Thierry Cools

This looks like a bug in the way WebLogic is doing URL rewriting.

The session id is required (by the servlet spec) to be passed as a
*path*
parameter, not a *query* parameter.  According to the RFC for URL syntax
(I
believe it's 2396, but don't have it available at the moment to check),
the
overall syntax goes like this:

scheme://host:port/resource-path;path-parameters?query-parameters

in other words, if I start with a URL like this:

http://myhost/myapp/logon.do?name=value

I should end up with a URL like this:

http://myhost/myapp/logon.do;jsessionid=12345?name=value

(which is what Tomcat and every other container I've tested does).  It
looks to
me like Weblogic is sticking the session id before the "/logon.do" part,
which
basically screws up the resource-path part of your URL.

Craig





Re: Properties in ActionForms

2001-01-11 Thread Craig R. McClanahan

Roger Kjensrud wrote:

> Hello,
>
> I wonder if any of you have implemented an automatic way of populating the
> properties in the ActionForm? It's kind of tedious to write all these setter
> and getter methods
>

For generating the code of a form bean automatically, that is something I want
to look at in the 1.1 time frame.  As well, we need to look at use cases where
you do not know the property names ahead of time, and need them to work totally
dynamically.

For populating the properties, if you are trying to copy things from a "business
logic" bean that has the same property names, consider the
PropertyUtils.copyProperties() method.

>
> I found an
> article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html)
> describing one way of doing this, and I would be interested in hearing some
> feedback on doing it that way.
>
> Thanks,
> Roger Kjensrud

Craig McClanahan





Re: Struts without SQL?

2001-01-11 Thread Craig R. McClanahan

Timur Mehrvarz wrote:

> Hello.
> We are not using SQL in the presentation-tier.
> All DB-access happens in the EJB-tier.
> Therefor, when building Struts we get an
> "cannot resolve symbol javax.sql.DataSource" in
>  share\org\apache\struts\action\ActionServlet.java:82
> What shall I do?
> Regards.

Although you are not using it, Struts has built-in support for creating a JDBC
DataSource.  In order to do this, you need to download and install the JDBC 2.0
Standard Extensions jar file, which you can get from
, because the compiled code references these
classes.

I will update the install docs to make this clearer.

Craig





Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread Laird J. Nelson

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
> On 1/10/2001 at 11:27 PM Laird J. Nelson wrote:
> > What is now needed is a navigation stack of some kind--perhaps even
> something that is written/phrased in terms of "traditional" UI
> metaphors.
> The other place this idea comes up is the problem with users
> bookmarking pages that require a form-based login.

Although in a J2EE context, that problem is solved for you by the
servlet container (something the vast majority of websites I've seen
don't seem to be aware of--i.e. that a lot of authentication-related
behavior is provided to you for free).

> One solution, that I admittedly have not tried, might be to set an
> attribute in the session context that your Actions would monitor, if
> they might need to return to some arbitrary place in your application.

What I'd love to have happen (warning; more thinking out loud) is to
make it so that Actions don't have to have *any* if/then logic in them
at all for these kinds of cases (if possible).  Every time you have to
say to one of your developers, "Please remember to put in the
check-for-the-logged-in-user's-name check at the top of each
page/servlet", you run the risk of having one of them forget to do this.
Or, to put it another way, this navigation stuff should probably go in
the controller servlet somehow.

> >Now think that somewhere in that flow a *logical* dialog box is
> supposed to present itself .. If the answer is Yes, then the next
> "screen" should be, well, the next screen.  If the answer is no, then
> the next "screen" should be the very same page that triggered this
> "dialog box" to appear, since after all when you dismiss a dialog box
> it goes away, leaving you right where you were before.
>
> I think here the "logical dialog box" would be the action, and the yes
> and no answers are mappings for that action from the
struts-config.xml.
> So your config might actually say, for "yes" forward to this path or
> action, or for "no" forward to that path or action.

But that information is not static.  "No" might return me to different
paths depending on where I was coming from (i.e. depending on where the
"dialog box" was invoked from).  Because, remember, "returning to a
page" is webspeak for "dismissing the dialog box" in regular UIspeak.
So even in the struts-config.xml, with all of its mapping semantics, you
can't always know where the user should be taken.

> If we needed "no"
> to go so some arbitrary page, then that might be something we can save
> and restore from the session context. It's also possible that the
> referer header could be used for automatic returns to a "grandparent"
> page.

Right; lots of frameworks and such handle cases back to the grandparent
level.  I'm suggesting that this should be generalized to handle any
ancestor as well.

> It's possible that we already have that functionality in the Action
> mappings. Each action can have it's own set of logical forwardings, or
> refer to a set of global forwardings. A nice feature here is that you
> can change and reload the mappings, without recompiling source!

Right, but you don't always have the information to build those mappings
in the first place.

Cheers,
Laird

--
[EMAIL PROTECTED]
http://www.amherst.edu/~ljnelson/
Good, cheap, fast: pick two.




Re: Strange problem using Weblogic 6.0

2001-01-11 Thread Craig R. McClanahan

Thierry Cools wrote:

>  Hi Craig, Thanks for your explanations, but the problem is different, maybe I
> was not very clear in my first mail. The problem is that, as you can see in
> the adress link, Weblogic add '/' characters in the jsessionid and the servlet
> engine doesn't seems to be able to recognize that the session id is not a part
> of the context path, so that the context path contains the real context path +
> the session id, the result of this is that the application can not access all
> following links because of this. I hope it was more clear this time. Thanks
> for your help,Thierry
> Thierry Cools

This looks like a bug in the way WebLogic is doing URL rewriting.

The session id is required (by the servlet spec) to be passed as a *path*
parameter, not a *query* parameter.  According to the RFC for URL syntax (I
believe it's 2396, but don't have it available at the moment to check), the
overall syntax goes like this:

scheme://host:port/resource-path;path-parameters?query-parameters

in other words, if I start with a URL like this:

http://myhost/myapp/logon.do?name=value

I should end up with a URL like this:

http://myhost/myapp/logon.do;jsessionid=12345?name=value

(which is what Tomcat and every other container I've tested does).  It looks to
me like Weblogic is sticking the session id before the "/logon.do" part, which
basically screws up the resource-path part of your URL.

Craig





RE: Properties in ActionForms

2001-01-11 Thread Schachter, Michael

Roger,

Although I can't think of any immediate implementations, this issue will be
actively addressed in 1.1, as noted on the TODO list:

http://jakarta.apache.org/cvsweb/index.cgi/jakarta-struts/src/doc/todo-1.1.x
ml

My current personal feeling on this matter is that form arguments should
possibly be tied a little closer to an underlying data model, making action
processing a little more protocol neutral.  But thats a whole different
story for now.

-Original Message-
From: Roger Kjensrud [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 12:40 PM
To: [EMAIL PROTECTED]
Subject: Properties in ActionForms


Hello,

I wonder if any of you have implemented an automatic way of populating the
properties in the ActionForm? It's kind of tedious to write all these setter
and getter methods

I found an
article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html)
describing one way of doing this, and I would be interested in hearing some
feedback on doing it that way.

Thanks,
Roger Kjensrud




Re: Can I use a Map.Entry as a bean?

2001-01-11 Thread Craig R. McClanahan

Chris Wilson wrote:

> > From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> [snip]
> > One interesting point that I discovered on my trails through the code is
> > that the "type" attribute on the logic:iterate tag does not appear to be
> > used at all. It certainly isn't taken into account when
> > bean:write is doing
> > its thing. This actually makes sense when you think about it - the
> > logic:iterate tag just puts a bean into the requested scope, and
> > it's up to
> > the retriever (in this case, bean:write) to decide what type it is.
>
> why is the type attribute even in the iterate tag then?  just curious...
>

Check out the org.apache.struts.taglib.logic.IterateTei class -- you will see
that the "type" attribute is used to define the Java data type of the scripting
variable that is exposed to the page.  This does not generally matter if you
only access the exposed bean with custom tags, but does matter if you try to
access it with scriptlets -- the default data type is java.lang.Object, so you
would have to cast all your method calls.

The same general pattern is followed in other places where the "type" attribute
is used for the same purpose, such as .

Craig





Properties in ActionForms

2001-01-11 Thread Roger Kjensrud

Hello,

I wonder if any of you have implemented an automatic way of populating the
properties in the ActionForm? It's kind of tedious to write all these setter
and getter methods

I found an
article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html)
describing one way of doing this, and I would be interested in hearing some
feedback on doing it that way.

Thanks,
Roger Kjensrud





Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread Ted Husted

On 1/10/2001 at 11:27 PM Laird J. Nelson wrote:
> What is now needed is a navigation stack of some kind--perhaps even
something that is written/phrased in terms of "traditional" UI
metaphors.  

The other place this idea comes up is the problem with users
bookmarking pages that require a form-based login. 

One solution, that I admittedly have not tried, might be to set an
attribute in the session context that your Actions would monitor, if
they might need to return to some arbitrary place in your application. 

You're right that it would be helpful to describe more of the Struts
framework in conventional IU metaphors. For example, in the case of

> "OK, go to the next screen that I'm being told to go to, or if I'm
not being told to go anywhere, go to this
default location".  

The action would get the "being told to" out of the request parameters
or form bean(s), and then get the "next screen" from it's
ActionMappings. 

>Or the Action might be able to say "oops, conditions aren't right to
advance; pop the stack and go back to where we were a
moment ago but display the following message".

Here, the form's validation action says "oops", sets the mesages as
needed in the ActionError collection, and returns to the input form
specified by the action mappings (from struts-config.xml). 

>Now think that somewhere in that flow a *logical* dialog box is
supposed to present itself .. If the answer is Yes, then the next
"screen" should be, well, the next screen.  If the answer is no, then
the next "screen" should be the very same page that triggered this
"dialog box" to appear, since after all when you dismiss a dialog box
it goes away, leaving you right where you were before.

I think here the "logical dialog box" would be the action, and the yes
and no answers are mappings for that action from the struts-config.xml.
So your config might actually say, for "yes" forward to this path or
action, or for "no" forward to that path or action. If we needed "no"
to go so some arbitrary page, then that might be something we can save
and restore from the session context. It's also possible that the
referer header could be used for automatic returns to a "grandparent"
page.

> It would be great if there were some kind of stack built into struts
to let this happen in one place.  You'd have your
EnterBillingInfoAction that would step through its *own* screen flow,
using perhaps its own stack, and then at the end of *its* stack would
know to "pop" back to the main navigation stack.

It's possible that we already have that functionality in the Action
mappings. Each action can have it's own set of logical forwardings, or
refer to a set of global forwardings. A nice feature here is that you
can change and reload the mappings, without recompiling source!


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/





Re: Newbie question on templates

2001-01-11 Thread Ted Husted

The template example defines a content JSP for each page in your
application. Each of  these may also have a companion HTML file with
the unique content for each page. 

page1.jsp <- page1.html 
page2.jsp < page2.html

This means you can keep your page content out of the JSP environment
all together. 

In practice, the only difference between page1.jsp and page2.jsp may be
where they get their unique content. 

All of these page files could also use other common elements, like 

header.html
menu.html
footer.html

which would be defined once for all the pages, and reference by each of
the page?.jsp above. These could also be JSP files, if needed.

The final element is the actual template file. In the example, this is
chapterTemplate.jsp. This defines the actual layout of the elements. 

Each of the page?.jsp's mentioned above, just say "what" to include,
not where to put it on the page.

You can do things like change the position of the menu bar without
editing all the page?.jsp files. You would just have to edit the
chapterTemplate.jsp file. Depending on how closely things were layed
out, it's also possible that you may need to edit the other common
elements (header.html, menu.html, footer.html - three files total), but
you would not need to edit the many page?.jsp's.

So in the end, your directly may look like this

header.html
menu.html
footer.html
template.jsp
page1.jsp
page1.html
page2.jsp
page2.html
< ... />
page999.jsp
page999.html

I'm not saying this is better or worse than Cedric's components, but I
think the Struts library will do what you mentioned.

*** REPLY SEPARATOR  ***

On 1/10/2001 at 4:01 PM Warren Strange wrote:

Hi,

I am just get started with struts, and have a question on templates.

>From the example given (templates-example) , it appears that you need
a
template file
for each content JSP that you want to lay out using the template. For
example:

introduction.html  (the content), and introduction.jsp (the template
reference)

optional.html (the content)  and optional.jsp (the template reference)

and so on

This approach seems rather cumbersome to me. If you want to change the
template
you might have go back and edit all the template reference files (e.g.
say
you add
'rightSideBar'  content, or something like that).

I want to define one common template (which includes standard headers,
footer,
etc. - possibly changing their behavior dynamically) and have it
applied
automatically
 to all my content.


How is done?

Thanks

Warren






RE: Can I use a Map.Entry as a bean?

2001-01-11 Thread Chris Wilson

see my comments below...

| chris wilson || web dev ||| [EMAIL PROTECTED] || | www.wondergeek.com |
|

> -Original Message-
> From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 10, 2001 11:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Can I use a Map.Entry as a bean?
>
>
> I've done some extensive digging around on this (because I wanted to use
> inner classes with the Digester as well), and found out what's going on.
> It's not an inner class thing per se, because I do have inner classes
> working with the Digester now.
>
> First, getValue() is public in both Map.Entry and TreeMap.Entry, so this
> wasn't affecting things. I assume getKey() is the same, but I haven't
> checked.
>
> What does matter is that Map.Entry is a public inner class, but
> TreeMap.Entry has only package access. Struts uses bean.getClass() to get
> the class, and looks up the getter method on that. Not surprisingly,
> getClass() returns TreeMap.Entry, so that when the getter is found, it is
> actually the TreeMap.Entry getter, which is not accessible from
> outside the
> package.

wow!  thanks for digging so deep.  it's nice to know what's actually going
on.

> What this tells us (I think) is that the PropertyUtils introspection code
> won't work on a bean whose concrete class is not public, even if it is
> derived from, and almost exclusively manipulated as, a public interface.
>
> One interesting point that I discovered on my trails through the code is
> that the "type" attribute on the logic:iterate tag does not appear to be
> used at all. It certainly isn't taken into account when
> bean:write is doing
> its thing. This actually makes sense when you think about it - the
> logic:iterate tag just puts a bean into the requested scope, and
> it's up to
> the retriever (in this case, bean:write) to decide what type it is.

why is the type attribute even in the iterate tag then?  just curious...

> OK, so much for the problem. What can we do about it? Well, in theory, we
> could add a "type" attribute to bean:write, and then have that passed
> through to where the introspection happens. The problems I see
> with this are
> that bean:write is undoubtedly not the only tag that would have to be
> modified to handle this, and that a pile of code would have to change so
> that the type can wend its way down to the appropriate introspection code.
>
> The only other alternative I can think of is a bit hairy. That would be to
> have the introspection code first figure out whether a method is
> accessible
> (by looking at the modifiers of the method and its class). If the
> method is
> not accessible, then the code would work its way down through the base
> classes and implemented interfaces to look for an accessible version, and
> use the corresponding class to call the method. Like I said, a bit hairy.
>
> On the other hand, we could just do nothing. I would assume that
> this is not
> something a lot of people will hit, and that Chris is just one of those
> unlucky folks. :-}

true... however, why is there even the ability to work with maps in this way
with the iterate tag then?  1) simply so i can use scriptlets to get at the
values of the entries?  if i'm going to use scriptlets, i might as well just
use scriptlets to iterate as well.  2) or in the hope that someone will
implement a map that doesn't use a protected map.entry class?  the only
reason i can see to fix it, is so that the working of the struts iterate tag
is consistent.  if i can't get at the stuff with tags, it's confusing to
iterate it with tags (in the case of maps).

i've since worked around this by basically stuffing my own 'entry-like'
class in a set which works great, except that it doesn't work like a map
when querying, only with iterating.  maps are handy for building select
lists and such and then getting the indexed value in a servlet somewhere
instead of having to iterate through an entire set.

i actually agree that it's probably not a big enough deal to fix or contend
with, i'm just a consistency freak :)

thanks for the help and info!

struts rocks,
chris

> --
> Martin Cooper
> Tumbleweed Communications
>
> - Original Message -
> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 12:32 PM
> Subject: Re: Can I use a Map.Entry as a bean?
>
>
> > Chris Wilson wrote:
> >
> > > here's a simple example  of what i'm talking about.  would one of your
> > > wizards please try this servlet and jsp page to see what i'm talking
> about?
> > > thanks very much!
> > >
> >
> > I did some playing with this as well.  It seems to be a Java
> API issue --
> > Map.Entry is an inner class, so apparently Java reflection APIs are not
> allowed
> > to call it's methods dynamically (the way that the Struts tags
> need to in
> order
> > to be generalized :-(.
> >
> > As you noted, using mapEntry.getKey() and mapEntry.getValue() directly
> seems to
> > work, so we could cheat if need be -- but 

Re: Spaces in URL's

2001-01-11 Thread Pierre Métras

Hi James,

> I'm using Struts and I noticed a problem with my web application when I
was
> running under Netscape 4.0.  I was getting different results than if I ran
> under IE.  It turns out that the reason is because my links have spaces in
> the parameter values:
>
> http://foo.com/app/foo.do?parm=I have spaces&parm2=I do to
>
> I'm using the  tag to generate the links.  It seems that this
> code should do some sort of URL encoding on the parameters, or am I just
> doing something wrong?  It doesn't seem to me that my property getter
> should worry about URL encoding the property value.
>

Yes, that's a known problem, first reported by Mathias Kerkhoff (struts-dev,
Nov 13, 2000): Struts uses indistinctly Beanutil.filter() that substitute
HTML characters, but not URI or parameters characters.
Solutions have been suggested, using java.net.URLEncoder or an ad-hoc class
(by me, struts-dev, Dec 06, 2000), but I don't think the corrections have
been applied.;-(

So, for the time being, either you encode your URL and parameters yourself
(change the link tag and others), either don't put sensible characters in
the URLs (' ', &, %, #, etc).

Pierre Métras




Web application w/Struts

2001-01-11 Thread Roger Kjensrud

Hello,

I'm dealing with some architectural design issues that I would like to get
some feedback on:

I'm striving for a loosely coupled architecture where each component would
be a web application (.war) that could potentially be deployed in different
JVMs on different boxes. However, all these components would need the same
basic information about the client that is obtained when he/she logs on. A
loosely coupled architecture would mean one ActionController per component
or one "instance" of the Struts framework. In this scenario I could pass the
user information between the components with cookies and/or hidden
fields(including security artifacts).

On the other hand I can package everything into one web application, using
one ActionController with proportionally higher number of Action classes.
This way the sharing of user information would be easily put into a session
object. However, I won't achieve the benefits of loosely coupling, and
maintenance and ownership of the code could become harder(separate teams
working on each component). Also, the security would be easier to handle in
this scenario.

The next part is related more to Struts:
When would you start to split up with into different ActionServlets as
suppose to adding more Action classes with the same ActionServlet? If you
specify several action servlets in web.xml with different mappings, would
these servlets be able to share a session?

Any feedback is appreciated.

Thanks,

Roger Kjensrud





RE: Struts without SQL?

2001-01-11 Thread Johan Compagner

Add the jdbc optional package to your classpath.
Even it you don't use jdbc you need that package.

johan


> -Original Message-
> From: Timur Mehrvarz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 2:40 PM
> To: [EMAIL PROTECTED]
> Subject: Struts without SQL?
> 
> 
> Hello. 
> We are not using SQL in the presentation-tier. 
> All DB-access happens in the EJB-tier. 
> Therefor, when building Struts we get an 
> "cannot resolve symbol javax.sql.DataSource" in 
>  share\org\apache\struts\action\ActionServlet.java:82
> What shall I do?
> Regards.
> 
> 



Re: Newbie question on templates

2001-01-11 Thread Cedric Dumoulin


  Hi Warren,

  In the Struts Template example, you define one template
(chapterTemplate.jsp) common to all your web pages.
  Then, you define one jsp file for each of your web page that use the
template (introduction.jsp, optional.jsp, ...). In each jsp file you specify
template argument values (header, body, ...). If you want web pages with
common part (ex : sidebar), define another template fixing this property
value. This template could possibly use the more general template.

  You can also have a look to my Component proposal
(http://gauss.ficsgrp.com/cdm). This can be seem as an extended template
library. It provides all Struts Template functionalities (with same syntax),
plus new useful functionalities to develop reusable 'web components'.
  I have rewrite the struts-template example using the Components. Chek it !
  Any comments are welcome to improve this Component library.

  Cedric

Warren Strange wrote:

> Hi,
>
> I am just get started with struts, and have a question on templates.
>
> >From the example given (templates-example) , it appears that you need  a
> template file
> for each content JSP that you want to lay out using the template. For
> example:
>
> introduction.html  (the content), and introduction.jsp (the template
> reference)
>
> optional.html (the content)  and optional.jsp (the template reference)
>
> and so on
>
> This approach seems rather cumbersome to me. If you want to change the
> template
> you might have go back and edit all the template reference files (e.g. say
> you add
> 'rightSideBar'  content, or something like that).
>
> I want to define one common template (which includes standard headers,
> footer,
> etc. - possibly changing their behavior dynamically) and have it applied
> automatically
>  to all my content.
>
> How is done?
>
> Thanks
>
> Warren




Struts without SQL?

2001-01-11 Thread Timur Mehrvarz

Hello. 
We are not using SQL in the presentation-tier. 
All DB-access happens in the EJB-tier. 
Therefor, when building Struts we get an 
"cannot resolve symbol javax.sql.DataSource" in 
 share\org\apache\struts\action\ActionServlet.java:82
What shall I do?
Regards.



begin:vcard 
n:Mehrvarz;Timur 
tel;work:0211 5334414  (vorübergehend: 0211 64996-459)
x-mozilla-html:FALSE
org:Mannesmann Mobilfunk;FIE
adr:;;
version:2.1
email;internet:[EMAIL PROTECTED]
fn:Timur Mehrvarz
end:vcard




Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread Elod Horvath

see interspersed comments below...


"Laird J. Nelson" wrote:
> 
> - Original Message -
> 
> I like to think of this as the "dialog box problem" that web UIs face.
> That is, each case above, in a "traditional" client-server program,
> would be implemented, usually, as a dialog box.  What's unique about a
> dialog box?  It pops up and gets in the way of where you (a) are or (b)
> were trying to go.  Only when you dismiss it are you "returned" to
> either (a) or (b).  On the web, of course, with our primitive HTML-based
> UIs, there are no such things as dialog boxes (unless you use
> javascript).  So "screen flow" becomes all important.
> 
> I bring this up because struts seems to have gone partway--better than
> any other framework I've seen--but not all the way in its support of
> this dialog box metaphor (it uses form beans).  What is now needed is a
> navigation stack of some kind--perhaps even something that is
> written/phrased in terms of "traditional" UI metaphors.  I'm thinking
> about some kind of stack--and believe me, I haven't thought this all the
> way through yet--that can be accessed by Actions, but any given Action
> would typically say something like "OK, go to the next screen that I'm
> being told to go to, or if I'm not being told to go anywhere, go to this
> default location".  Or the Action might be able to say "oops, conditions
> aren't right to advance; pop the stack and go back to where we were a
> moment ago but display the following message".  Things on the stack
> would be *roughly* equivalent to screens--though I hesitate to use
> "screen" as I think that's one of the major shortcomings of the Turbine
> framework, because a "screen" on the web often exists as a separate
> entity only because the marketing department said it has to.

Actually, I've implemented just such a construct at work for the struts
based prototype of a significant financial web-application shell. There 
 
was some discussion on this list some time ago about something called a 
StateManager, which is essentially what this is.  And yes, the concept
of 
"screen" is fuzzy -- in my situation, a "screen" is really a [at times] 
complicated and changing frameset.  

The app/shell's flow follows a (process/state update/redraw) pattern 
in a [con]federation of sub-applications (and thus, controllers).  
See my attached diagram with numbered steps as follows:

1)  Application Request
Client-side user triggers a request to the server.

2)  Sub-application Controller Dispatch
Dispatches the request to the appropriate action handler.

3)  Action Request Processing
The actions process the request, invokes relevant business logic,
sets up data and state beans.

4)  Redirect Response
Initial request response is _always_ a redirect to a single URL
to redraw the application window.

5)  Window Redraw Request
There is one global window redraw request handled by the main
controller servlet.  This request "repaints" the entire browser
window based on the current state of the application.

6)  Main Controller Dispatch
Dispatches the request to the appropriate action handler.

7)  Action Request Processing
This sets up the request object and determines the correct views to
"forwards" to based on what's on top of the page stack.

8)  Request Forwarded (dispatched) to Views
   
9)  JSP Views Render Response

10) Final Result Response
Response to the redraw request.

(apologies for the detail level in these steps -- I lifted this diagram
 and description from the system overview documentation I'm working on
 at work (geared towards newbie developers in my group))

one side benefit of this indirected approach is that the application
has _total_ control over what the user sees...because all requests 
_always_ result in a redirect to the same _global_ repaint action,
the browser's navigation buttons are effectively disabled; the user always
gets presented what is currently at the top of the pagestack -- be it
error page, form, interjected "dialog" window, etc.  The framework
effectively hides the implementing JSP views from the browser's URL
location making it more difficult for the user to bookmark intermediate 
pages or the browser to track page history (something which is usually 
not desirable, especially with sensitive apps/sites).

I hope this was helpful...

e

-- 
___
Elod Horvath ('e')   /  ITFAIS Records (http://www.itfais.com/)
Unknown Document



bean:parameter error?

2001-01-11 Thread Matthias Bauer

Hi all,

I am quite new to struts, so I am not sure, if am doing something wrong or if I
fund a struts bug. Here is my code that does not work:

> 
>   
> 

This is the result I get:

> Location: /mystruts-example/index.jsp
> 
> Internal Servlet Error:
> 
> org.apache.jasper.JasperException: Unable to compile class for 
>JSP/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:155:
> Missing term.
>   _jspx_th_bean_parameter_0.setName("test");
> ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:156:
> ']' expected.
>   [Ljava.lang.String; testBean = null;
> ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:159:
> Missing term.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
>   ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:159:
> ']' expected.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
> ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:164:
> Missing term.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
>   ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:164:
> ']' expected.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
> ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:168:
> Missing term.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
>   ^
> 
>/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java:168:
> ']' expected.
>   testBean = ([Ljava.lang.String;) 
>pageContext.findAttribute("testBean");
> ^
> 8 errors
> 
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
> at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
> at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
> at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
> at 
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
> at 
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> at org.apache.tomcat.core.Handler.service(Handler.java:286)
> at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at 
>org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at 
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
> at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)


This is the relevant code snippet in
/opt/jakarta-tomcat-3.2.1/work/localhost_8080%2Fmystruts-example/_0002findex_0002ejspindex_jsp_11.java
(the error line is marked with ???):

>   // begin 
>[file="/home/hias/hias/mystruts-example/index.jsp";from=(12,0);to=(12,32)]
>   /*   logic:present  */
>   org.apache.struts.taglib.logic.PresentTag _jspx_th_logic_present_0 
>= new org.apache.struts.taglib.logic.PresentTag();
>   _jspx_th_logic_present_0.setPageContext(pageContext);
>   _jspx_th_logic_present_0.setParent(_jspx_th_html_html_0);
>   _jspx_th_logic_present_0.setParameter("test");
>   try {
>   int _jspx_eval_logic_present_0 = 
>_jspx_th_logic_present_0.doStartTag();
>   if (_jspx_eval_logic_present_0 == Body

Re: struts:errors

2001-01-11 Thread Ted Husted

The ActionForm in Struts represents a "logical" form in your
application. So, there is not necessary a direct 1:1 relationship
between an ActionForm and a single HTML form on a single page.
Sometimes, the properties of an ActionForm will be presented over
several requests, as in a wizard-type request. Other times, the
properties of a single ActionForm may be presented in several HTML
forms during the same request. 

Given the lockstep request/reply nature of HTTP, I don't see how it is
possible to validate two ActionForms at once. The solution would be to
have a single ActionForm that wraps the properties of Classes "A1" and
"A2", just as your HTML page provides the HTML both form1 and form2 to
the user. Classes A1 and A2 might be represented on several ActionForms
in the course of your application.

A good way to go about this is to setup classes A1 and A2 as data
JavaBeans, and make the databeans instance variables on your dataforms.
Until recently, you would have then had to write mutator and accessor
wrappers for your databean properites, so that the HTML form tag could
see them. 

However ... (dramatic pause) ... using the most recent build, you can
now  use simple/nested/indexed expressions like this:
  
  
  
and the appropriate processing will be applied to get the street
address (for initial display) and set the street address (when the form
is processed).

Your validation method would then queue up whatever error messages
should be communicated to the user, and display them all on your input
form. (ActionErrors is a collection.)

In Problem 2, you also have access to the HTTP request in the
validation method, so you could perform a different validation
depending on what HTML page (login or signin) submitted the request. 

Note that you can also defer some (or even all!) validation until the
Action. For example, whether the password as valid for that given
username would probably be verified in the Action, rather than on the
Form, and the user forwarded back to the input form if it didn't check
out. The ActionForm validations are usually about the format of the
input, and could just as well be performed client-side with JavaScript.
(Generating client-side JavaScript validations via custom tags is on
the list for Struts 1.1)

** REPLY SEPARATOR  ***

On 1/10/2001 at 11:27 AM John Hunt wrote:

Hi 
Say, if I have two forms form1 and form2 in a page and
correspondingly I have two ActionForm classes A1 and
A2 which validate those two forms, how can I display
the errors during validation of form1 and form2
SEPARATELY.
What does  display in such scenario? 
How can I uniquely identify errors returned by form1
and form2 instead of displaying them together.

Problem 2:
Suppose I have a scenario where I have form1 and form2
( say login and sign up ) in a page. As part of the
validation, I would be having null check for username
& password fields in the each form and return an error
if both fields are null in a form. We would expect the
user to fill either login form or singup form. In such
scenario either path he follows is a success. But
because of our validation checks ( both login and
passwd r null for any one of them he doesnt fill ) we
will be getting an error. Any thoughts as to how we
can handle this?
Thanks
Hunt

__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/






AW: How to return file content?

2001-01-11 Thread Lind Jürgen

Craig,

thank you for your immediate help. Trying it out, however, I found some
rather strange behavior of my code: the "perform" method of the Action
that returns the pdf file seems to be called a second time after the
the file has been sent. This seems to cause the browser to try to
display something very strange (because it complains about a missing
plug/in). I tried the file return code in isolation (in a simple
servlet without struts) and it worked just fine. Am I missing something
here?. 

Here is the code that I am running:

public final class ViewAction extends Action{

  public ActionForward perform(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
throws IOException, ServletException {

System.out.println( "enter view::perform" );

String cmd = this.getCmd( request );
System.out.println( "cmd=" + cmd );

if( cmd == null ){
  System.out.println( "exit view::perform (cmd==null)" );
  return null;
}

if( cmd.equals( "Quelle" ) || cmd.equals( "Ziel" ) || cmd.equals(
"Dauer" )){
// do something ...
  System.out.println( "exit view::perform (sort)" );
  return new ActionForward( mapping.getInput() );
}

if( cmd.equals( "pdf" ) ){
// return pdf file ...
  ServletOutputStream out = response.getOutputStream();
  response.setContentType( "application/pdf" );
  try{
this.returnFile(
"c:\\www\\public_html\\webapps\\odin-tracer\\tmp\\pdfoutput.pdf", out );
  }
  catch( FileNotFoundException e ){
e.printStackTrace();
  }
  catch( IOException e ){
e.printStackTrace();
  }

  System.out.println( "exit view::perform (pdf)" );
  return null;
}

System.out.println( "exit view::perform (end)" );
return null;
  }
}

Running this code gives the following output (with hitting the "submit" 
button in the form only once):

enter view::perform  
cmd=pdf 
exit view::perform (pdf) 
enter view::perform 
cmd=null 
exit view::perform 
(cmd==null)


Any clue what is going on here?

Best Regards,

Jürgen

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de