Re: still fighting HTTP HTTPS problem

2001-05-11 Thread Jonathan Asbell

Mike.  Dude.  That IS the way to do it.
1) check to see if you ACTUALLY GET the 2 sessions (if you can get them, do
a session.toString() to see that they are not the same session indeed)
2) you should be sending the serialized data from the unsecure session into
the secured session:
if you are using an non visual jsp to process it would go something like
this
a) get the query string and hold it
b) get the data you want from the non-secure session, includeing the session
id and encode it
c) make an name value pair for the session stuff and dont forget to encode
the value (unsecure_session_contents=thedatayouareholdingfromthesession)
d) add the new name value pair to the query string you are holding
e) forward the whole shebang to the secure url you are going to.
f) on the secure side get the request and put the
request.getParameter(unsecure_session_contents) into the new Secure session.
g) do the same for the return trip, but remember when you return you have to
try to look up the session with the id you saved.  If its gone its because
you timed out.

- Original Message -
From: "Michael Wilimsky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 6:20 AM
Subject: still fighting HTTP HTTPS problem


> hello everyone...
>
> i still couldn´t find a solution on how to switch from
>
> let´s say http://localhost:myport/myapp/something.jsp to
>
https://localhost:mysecureport/myapp/somethingelsethatneedstobesecure_oreven
> thesamepage.jsp
>
> while retaining resp. cloning the content of my sessioncontext...
>
> i am using the urlrewriting-method to manage my sessions
>
> as far as my experience tells me i get two different sessionIDs for
>
> http://localhost:myport/myapp/something.jsp
> and the corresponding
> https://localhost:mysecureport/myapp/something.jsp
>
> how can i copy the sessioncontext to the secure side and vice versa?
>
> michy
>




Re: XML Data out of a property into an XSL Transformation by JSP-Tag

2001-05-14 Thread Jonathan Asbell

You can use the ActionForward to send you to a jsp page which contains a tag
(or tags) which do any one of the following:

1) A Tag/Action calls business objects which in turn get xml, transform the
xml using a stylesheet, and slaps the resulting html in the space where the
tag sits on the jsp page

2) A Tag/Action calls business objects which in turn get xml, transform the
xml using a stylesheet, puts the result in a bean which is retrieved by the
Tag/Action

3) A Tag/Action calls business objects which in turn get xml, puts the xml
result in a bean which is retrieved and iterated over by the Tag/Action

4) Tag/Action calls business objects which return return xml, which is
transformed on the Tag/Action level using a stylesheet

The point is:
You can start with xml and stay with xml up to the web layer and do
transforms there
You can start with xml, transform in the lower layer, and send html up to
the web layer
You can start with regular string data, make a dom, and send it around (I
dont recommend this)
etc. etc. etc.

>From experience, I recommend that if you are actually going to need to work
with xml, DONT USE STYLESHEETS, but rather make "model" objects from the xml
which you can iterate over.


- Original Message -
From: "Sean Pau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 14, 2001 12:53 PM
Subject: RE: XML Data out of a property into an XSL Transformation by
JSP-Tag


> me too looking for something similar. Looking for Struts to generate XML
and
> passthrough XSLT to transform to HTML, WAP, PDF etc. Is Cocoon a solution?
> Is there something lighter, simpler but with the Cocoon caching mechanism?
> Or is servlet filter a solution? Thanks
>
> -Original Message-
> From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 14 May, 2001 11:21 PM
> To: [EMAIL PROTECTED]
> Subject: XML Data out of a property into an XSL Transformation by
> JSP-Tag
>
>
> Has anyone integrated struts with XML/XSL by populating a property with
> XML-data and processing this data with XSLT and by using a custom
> JSP-Tag.
>
> With other words: Is there a good way to include an XSLT-Output into a
> JSP page?
> Have you a sample code?
>
> TIA
> Hartmut Bernecker
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>




Re: Donating Xml Configurable Character filter

2001-05-23 Thread Jonathan Asbell

look at it closer Jeff.  It does not touch the escaped url string itself,
but rather the actual characters de-coded from the url using the decoding
you specify.  Also, you decide the appropriate mapping.  Go to the xml file,
make your own mapping, and call it instead of the one I did called "resume"
or whatever it is.  It just stores as many named mapping schemes you like,
and you call the one you want.

- Original Message -
From: "Jeff Trent" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan" <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 7:55 PM
Subject: Re: Donating Xml Configurable Character filter


> I disagree with this proposal.  Your so called disallowed characters could
> be perfectly reasonable in certain contexts.  For example, question marks
> are perfectly valid for capturing dailog.  Parens are perfectly valid when
> capturing phone numbers, etc.
>
> There is some merit to your basic idea, however.  I think what is instead
> needed is a way to encode/decode these special characters before they
reach
> the form and once again before they reach the database.  For example, '%'
> has special meaning on most relational databases so it would be nice to
have
> a encoder (not a filter) which can handle the encode/decode process
> seemlessly.  But on the other hand, this is not the goal of the struts
> framework.  While you can argue that this encode/decode feature is
> appropriate for the form accessors, I doubt struts will ever provide for a
> way to encode/decode your db access.
>
> - jeff
>
> - Original Message -
> From: "Jonathan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 23, 2001 3:24 PM
> Subject: Re: Donating Xml Configurable Character filter
>
>
> > If you look closely, you will first see that the mapping is in memory,
and
> > that it only does conversions for values that are in the map.  What is
not
> > in the map is not changed.  If a value IS in the map, it will convert it

> to
> > what you have mapped it to.  Regarding "overkill", it may or may not be.
> I
> > needed to use it because we are having the biggest problems with xml,
> > unicode characters, utf-8, and internationalization.  It is not
> necessarily
> > to be used on the web tier alone, although it can be.  You guys use that
> > "fast Hash Map", which could be employd here since its read only.  Also,
> > people on the list have been looking for a character filter, and here is
> > one.  It may be useful or not.  You guys are the brains around here ;^>
> I'm
> > just trying to learn from you.=)
> >
> > Jonathan
> >
> > - Original Message -
> > From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, May 23, 2001 1:54 PM
> > Subject: RE: Donating Xml Configurable Character filter
> >
> >
> > > Hi Jonathan,
> > >
> > >  This is interesting stuff you are sending. Don't you think it is
a
> > bit
> > > of an overkill ? Correct me if i am wrong, on a heavy traffic website
i
> am
> > > thinking this might slow down the applicationa  lot. I am thinking of
a
> > > simple filter which use the methods that String class provides.
> > >
> > >  I think you can basically convert every string into a char array.
> > > Depending on the flag you convert either the allowedCharacters (or)
> > > disallowedCharacters into a char array. For every element of this
array
> > you
> > > try to find an index into this input String. If index is != -1, the
> > > character is present in the input string. You then decide what you
want
> to
> > > do with the character. Since i will be dealing with international
> > characters
> > > aswell, i can put the characters as an unicode value in the properties
> > file.
> > > That way i will have flexibility and ease of maintenance of the
> character
> > > set that i want to control in an application. Since the user input
(per
> > > field) can at the max be around 50-250 characters, i don't think it
will
> > be
> > > a performance hit. On a heavy volume application ( with > 100 users at
a
> > > time ) i wonder what will be the performance hit ? I would really
> > appreciate
> > > your feedback on this. Thanks a lot.
> > >
> > > cheers,
> > > Amar..
> > >
> > >
> > > -Original Message-
> > > From: Jonathan [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, May 23, 2001 1:03 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Donating Xml Configurable Character filter
> > >
> > >
> > >
> > > Character Filter Donation
> > >
> > >
> > > - Original Message -
> > > From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, May 23, 2001 9:39 AM
> > > Subject: Suggestions for Struts 1.1 TODO LIST  Request Filtering
> > > technology for Struts
> > >
> > >
> > > > Hi Everybody,
> > > >
> > > >  I would really like the opinion of the big heavyweights who
> > designed
> > > > this framework. I have a small but important suggestion to make for
> the
> > > > struts 1.1 todo l

Request from contributer user.....

2001-05-24 Thread Jonathan Asbell



Hello all.  I am still only a few months 
playing with struts but I would like to ask if you wouldn't mind 
putting more detailed debugging in the framework.  I personally am 
studying the framework by reading about it, but most importantly by watching how 
it performs step by step.  I do this by adding the same type of statements 
as yours, but if you set a debug level of 5 it gives you a step by 
step view of what is occuring.  Could you consider this.  It is 
because it is hard enough to understand a framework when you really cant see 
exactly what is happening.  But it is a nice framewor ;^>
 
respectfully
Jonathan


Which component employs the

2001-05-30 Thread Jonathan Asbell



is this template tag part of Struts?
 



Re: Resources clarification - is there a work around

2001-05-30 Thread Jonathan Asbell

Thanks Pete.  However it just seems strange that Struts just offers one big
resource file for each Local.  I have developed 3 international sites, and I
can safely say that when a set of resources are associated with a particular
page it is much easier to manage than 1 resources for all pages.  Has anyone
hacked at the Struts code to get around this?  I dont like the concatenating
idea because it is too easy to have duplicates; and you probably want to use
the same resource names anyway to keep a consistency.  Anyone else have any
ideas?

- Original Message -
From: "Peter Alfors" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 9:33 AM
Subject: Re: Resources clarification :^)


> You could combine all of your property files during your build.
> This would allow you to have as many different property files as you
> want.
> However, you need to be careful that you do not have duplicate names
> across multiple files.
>
> HTH,
> Pete
>
> Jonathan wrote:
>
> > Hello all.  It appears that the ActionServlet points to a resources
> > file, and not a ResourceBundle object. Is this true?  The reason is
> > that I would like to group in the same directory the following:1) a
> > particular ActionForm2) the Action class that works with that
> > ActionForm3) the resources (strings) that work with that
> > ActionForm The reason is that it is much easier to manage the
> > artifacts on a page by page basis.How can I do this
> > properly ThanksJonathan
>




Re: Resources clarification - is there a work around

2001-05-31 Thread Jonathan Asbell
w which would be more efficient ? Having
a
> single Resource Bundle (or) Multiple Resource Bundles ? Which one can give
> the user faster lookup access ?
>
>
>   At present we have close to 2000+ (properties + error msgs) in the
> properties file and the number would most likely quadruple by the time we
> take it to production. I would certainly like to hear your opinions on
> thisesp from people who have deployed their applications...
>
> just my 2cents
>
> cheers,
> Amar..
>
>
>
>
> -Original Message-
> From: Jonathan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 10:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Resources clarification - is there a work around
>
>
> Hi Peter.  Read the whole thread and you will see some good examples as to
> why I want to do this.
>
> I think I will end up doing some surgery on the struts classes.  I will
> associate the page I am forwarding to with a properties file, maybe inside
> the struts-config.  That will mean I will have to look at the dom
> manipulation which gets the values and ad another group of items (the
> associated properties file) to a hashtable or object. I will put the
> properties files in the same directory as the jsp page but protected.  I
> will try to protect all files that end in ".properties".
>
> I would love to hear suggestions from Niall, Ted, Craig, Hal, Jeff,
Nanduri,
> Dave etc
>
>
> - Original Message -
> From: "Peter Alfors" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 31, 2001 10:03 AM
> Subject: Re: Resources clarification - is there a work around
>
>
> > We are currently using two different resource bundles.  One for our
> messages and
> > another for our constants (that define
> > web look and feel).  To do this, we overrode the init() method in the
> > ActionServlet and added another method to initialize a second bundle
into
> a
> > different session attribute.
> > This works well for 2 different bundles, but it would not be practical
for
> a
> > large number or bundles (one per page).
> >
> > Maybe there would be a way to initialize all of the page bundles at
> startup?
> > Some sort of loop or somethine?
> > I don't have any suggestions on how this would work, but maybe it is a
> starting
> > point??
> >
> > One supporting reason for a single bundle would be this...  It allows
you
> to
> > easily keep consistent naming across your app.
> > For instance, if each of your pages has the label "Id", but then later
on
> you
> > (or the customer) decide that "Name" is a better choice, you only have
to
> change
> > it in one place.  There are other situations as well, this is just one.
> > Also, creating new locales is as simple as handing a single resource
> bundle over
> > to your translater, rather than 100 different bundles to duplicate.
> > As for naming problems, there is a simple solution.  Use a naming
strategy
> for
> > each key.
> >
> > .=Value
> > or
> > common.=Value <-- if this is common across all pages.
> >
> > HTH,
> > Pete
> >
> >
> > Jonathan Asbell wrote:
> >
> > > Thanks Pete.  However it just seems strange that Struts just offers
one
> big
> > > resource file for each Local.  I have developed 3 international sites,
> and I
> > > can safely say that when a set of resources are associated with a
> particular
> > > page it is much easier to manage than 1 resources for all pages.  Has
> anyone
> > > hacked at the Struts code to get around this?  I dont like the
> concatenating
> > > idea because it is too easy to have duplicates; and you probably want
to
> use
> > > the same resource names anyway to keep a consistency.  Anyone else
have
> any
> > > ideas?
> > >
> > > - Original Message -
> > > From: "Peter Alfors" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, May 30, 2001 9:33 AM
> > > Subject: Re: Resources clarification :^)
> > >
> > > > You could combine all of your property files during your build.
> > > > This would allow you to have as many different property files as you
> > > > want.
> > > > However, you need to be careful that you do not have duplicate names
> > > > across multiple files.
> > > >
> > > > HTH,
> > > > Pete
> > > >
> > > > Jonathan wrote:
> > > >
> > > > > Hello all.  It appears that the ActionServlet points to a
resources
> > > > > file, and not a ResourceBundle object. Is this true?  The reason
is
> > > > > that I would like to group in the same directory the following:1)
a
> > > > > particular ActionForm2) the Action class that works with that
> > > > > ActionForm3) the resources (strings) that work with that
> > > > > ActionForm The reason is that it is much easier to manage the
> > > > > artifacts on a page by page basis.How can I do this
> > > > > properly ThanksJonathan
> > > >
> >
>




Re: Any body trying struts wit weblogic?

2001-06-01 Thread Jonathan Asbell

Ive got it working under WL 6.  If you want to know anything just email me
personally at [EMAIL PROTECTED]

- Original Message -
From: "Firmin David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 01, 2001 6:26 AM
Subject: RE: Any body trying struts wit weblogic?


> There have been many discussions, some quite recently, about setting up
> Struts under various versions of weblogic. Take a look through the mailing
> list archive to see if you can find what you're after there.
>
> [EMAIL PROTECTED]/
> 
>
> HTH
> Dave
>
> -Original Message-
> From: Manoj Deb [mailto:[EMAIL PROTECTED]]
> Sent: 01 June 2001 11:01
> To: [EMAIL PROTECTED]
> Subject: RE: Any body trying struts wit weblogic?
>
> What kind of help you want?
>
> Regards,
> Manoj
>
> -Original Message-
> From: ameer [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 3:37 PM
> To: Struts
> Subject: Any body trying struts wit weblogic?
>
>
> Hi i need help in using struts in weblogic .. pls anybody help
> Ameer Hussain SS
> s/w engineer
> Yashaa Infotech Pvt.Ltd.
> http://www.yashaa.com 
>
>
>
> 
> The information in this email is confidential and is intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised. If you are not
> an intended recipient, you must not read, use or disseminate the
> information contained in the email.
> Any views expressed in this message are those of the individual
> sender, except where the sender specifically states them to be
> the views of Capco.
>
> http://www.capco.com
> ***
>




*TED* Re: I am finding that templates are SLOW

2001-06-01 Thread Jonathan Asbell

the Exception

javax.servlet.jsp.JspException: JSP compilation of /inc/template2.jsp
failed: weblogic.utils.ParsingException: nested TokenStreamException:
antlr.TokenStreamExc
eption: Could not include inc/imports.jsp
at
org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:149)
at jsp_servlet._logon._jspService(_logon.java:160)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:213)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:246)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1265)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1622)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


the page "logon.jsp"

<%@ include file="inc/imports.jsp" %>

 
 




the template "my_template.jsp"

<%@ include file="inc/imports.jsp" %>



.





Common include "imports.jsp"

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 01, 2001 5:10 PM
Subject: Re: I am finding that templates are SLOW


> Template pages can take longer to compile, since there is more to do,
> but should run fine after that.
>
> I've used complex templates extensively with other containers and have
> no runtime performance problems.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
> > Jonathan wrote:
> >
> > I am using weblogic 6 on w2k.  I clicked on a templated page and
> > MAN.I wait atleast 1 minute for the results.  Is this known?
>




Re: filtering unwanted characters

2001-06-01 Thread Jonathan Asbell

See the character filter I donated last week

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 01, 2001 9:31 PM
Subject: Re: filtering unwanted characters


>
>
> On Fri, 11 May 2001, Ian Kallen <[EMAIL PROTECTED]> wrote:
>
> >
> > Apache 2.0 supports input filters, how about writing one that cleans the
> > data input before mod_jk/mod_webapp can hand it off to Tomcat?
> >
>
> In a Servlet 2.3 environment (such as Tomcat 4.0), you can use the new
> Filter APIs to accomplish the same thing.
>
> However, either of these approaches means you have to parse out the
> request parameters and put them back together again for the
> "real" servlet.  That sounds like a lot more work than should be needed.
>
> > On Fri, 11 May 2001, Nanduri, Amarnath wrote: > I am looking for some
> > open source code that deals with filtering > technology. Basically i
> > want to filter any unwanted characters from the user > input data. The
> > user might try to pass in some SQL quesries or try to run > some shell
> > scripts or put special characters which might be rejected by a >
> > database (or even corrupt it). If no such open source code is
> > available then > i want to write something like that. I was wondering
> > if anyone has done some
> >
>
> Have you considered putting stuff like this in the validate() method of
> your form bean?  You could probably write a common utility method that
> scanned a String for unwanted characters, returning "true" if there was a
> problem.  Then, your validate() method would pass all the input strings in
> the form through this method to look for problems.
>
> The other thing that really really helps when doing database stuff is to
> use JDBC PreparedStatement objects.  That way, even if your users try to
> pass in wierd command delimiters and stuff, it ends up inside an SQL
> string that is properly quoted by the driver itself, rather than modifying
> the SQL command you are trying to run.
>
> > cheers,
> > -Ian
> >
> > --
> > Ian Kallen <[EMAIL PROTECTED]> | AIM: iankallen
> >
> >
>
> Craig
>
>




Struts status items list /\/\/\

2001-06-01 Thread Jonathan Asbell



Can any one of you put together a list? We need to 
know:
1) what can currently be thrown out (assuming I 
have the most recent evenings build)
2) what are, and where can we obtain all 
of the recently contributed pieces which are under consideration, being worked 
on or tested (the Token mechanism submission, the iterate patch, the message 
patch, validation, bean factory, auto beans,  etc. etc. etc.)
3) what is next item that has been decided but has 
not been included in any nightly build.
4) what specific areas are we 
currently looking at to solve 
 
Just a brief list for the rest of us to have an 
idea of current state and the direction in the near future.  It will 
effect what we are personally building.
 
Cheers.
Jonathan


Credit card validation FYI

2001-06-02 Thread Jonathan Asbell



You all probably know about this but I thought I 
would send it anyway.
 
http://www.beachnet.com/~hstiles/cardtype.html
 
MOD-10 is an algorithm that is used by almost any 
credit card company togenerate / validate credit cards.How it 
works?First you have to know what kind of credit card you have.You can find 
itoutby looking at the first(leftmost) number of it.This is what 
itmeans:3= American Express4 = Visa5 = Mastercard 
etc.The algorithm goes as follows : go from right to left and multiply 
everysecond digit by 2.If the result of themultiplication is greater 
than 9 , subtract 9 from it.(ex. if 16 then 16 -9 = 7).Thenn add the result 
to the sum.All other numbers of the card don't need to be multiplied , just 
add themto the sum..When on the end (sum mod 10) = 0 ,the card is valid.In 
otherwords it means that the sum must be a multiple of 10 
(10,20,30).Example:5 4 2 4 1 8 0 0 2 6 7 6 9 0 0 
5---1+4+4+4+2+8+0+0+4+6+5+6+9+0+0+5 = 
58This card of course isn't valid because the sum (58) isn't a multiple 
of10.How to generate cards?Well if you want to generate 
cards , you first have to decide what type ofcards.If you would decide for a 
Mastercard, then the first number would bea constant of 5.Therefore we will 
have to go from left to right to generatecards.The sum will have a value of 
1 on the beginning (see example).Thengenerate random numbers up to the 15th 
digit.Like described above, multiplyevery second number and add all results 
together to a sum.Then calculatethe last number (checksum): if sum is a 
multiple of ten, then the 16thnumber (checksum digit) will be 0.Otherwise 
substract the sum from the nexthighest multiple of 10.In the example 
above we would say : 60 - 53 = 7.Therefore the last digit is7 and not 5.You 
could do that in pascal by saying : last_number:=10 - (summod 10) ;Now 
someone might say that he could generate as many cards as he wants andcould 
misuse them.But that's not the truth.Many online verificationservices will 
also check your user info and expiration date with your bank,which of course 
can't be generated by this program.I've however heardmyself that there are 
many small companies(XXX - sites,Online downloads)which still use only 
MOD-10 scripts for validation.


Re: newbie to struts - confirm hierachy( packages - webapps)!!

2001-06-05 Thread Jonathan Asbell



I decided to NOT use the Struts.jar, but instead 
use the Struts source files, and then add my own directories below the classes 
directory for that particular web app.  That way I could tweak Struts and 
have a better way of replacing updates to the classes.  My setup is like 
this:
1) Struts framework - /struts/org/apache/struts 
etc... with my classpath pointing to /struts
2) My framework - /vnu/com/vnu/ etc... with my 
classpath pointing to /vnu
3) My classes for the particular web app - 

WEB-INF/classes/com/mywebapp/actions
WEB-INF/classes/com/mywebapp/forms
WEB-INF/classes/com/mywebapp/globals
WEB-INF/classes/com/mywebapp/models
WEB-INF/classes/com/mywebapp/taglib
with the classpath pointing to WEB-INF/classes

  - Original Message - 
  From: 
  Chuck Amadi 
  To: Craig R. McClanahan ; Petr 
  Jiricka 
  Sent: Tuesday, June 05, 2001 5:31 
AM
  Subject: newbie to struts - confirm 
  hierachy( packages - webapps)!!
  Hi, i have constructed a web app within my file system as 
  follows:- 
  C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\classes\logon\LogonForm.java 
   The struts-bbnpa is were im placing all my work. thus the examples 
  custom and logon packages are beneath my classes directory. Thus is this the 
  correct procedure as im about to venture into JDBC Project (Postgresql) and im 
  not sure weather the packages are one level above \WEB-INF dir. 
  Any suggestions and confirmation extremely welcomed. Cheers inadvance. 
  Chuck (Graduate Systems Programmer) -- The views expressed by the 
  sender of this message don't necessarily represent those of Brecon Beacons 
  National Park Authority. This message is intended for the addressee(s) 
  only and is sent in confidence; if you receive it in error, please can you 
  let us know (at [EMAIL PROTECTED]) and then destroy all copies. 
  Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn 
  adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges 
  yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i 
  hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a 
  fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch 
  bob copi.   


Re: newbie to struts - confirm hierachy( packages - webapps)!!

2001-06-05 Thread Jonathan Asbell

jeez.  You are up early!

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 6:30 AM
Subject: Re: newbie to struts - confirm hierachy( packages - webapps)!!


> Some people like to keep the source Java files at a separate location,
> and then have Ant copy them over to the classes directory, but mixing
> the class and java files in the same folder works too.
>
> Personally, when using a package hierarchy for my classes, I tend to
> just name things
>
> .\logon\Form.java
>
> But, yes you should either put your packages class files below the
> classes directory, or in a JAR in the lib folder. For development at
> least, you probably just want to put them under classes.
>
> We put these under the WEB-INF folder so that they cannot be directly
> accessed by a client program (e.g. Web browser), only by the
> application.
>
> Chuck Amadi wrote:
> >
> > Hi, i have constructed a web app within my file system as follows:-
> >
C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\classes\logon\LogonForm
.java
> >
> >  The struts-bbnpa is were im placing all my work. thus the examples
> > custom and logon packages are beneath my classes directory. Thus is
> > this the correct procedure as im about to venture into JDBC Project
> > (Postgresql) and im not sure weather the packages are one level above
> > \WEB-INF dir.
> >
> > Any suggestions and confirmation extremely welcomed. Cheers inadvance.
> >
> > Chuck (Graduate Systems Programmer)
> > --
>




2nd try - excellent links on internationalization

2001-06-05 Thread Jonathan Asbell



http://www.acoin.com/i18n/
 
http://www.cs.uu.nl/wais/html/na-dir/internationalization/programming-faq.html
 
http://www-106.ibm.com/developerworks/java/library/j-rbmgr/index.html?dwzone=java
 
http://www-105.ibm.com/developerworks/education.nsf/java-onlinecourse-bytitle/F0CB1417D1C6BD99862569060062A7E5?OpenDocument
 
http://www-106.ibm.com/developerworks/library/unicode.html
 
http://web2.java.sun.com/docs/books/tutorial/i18n/text/string.html
 
http://www.javaworld.com/javaworld/jw-03-2000/jw-03-ssj-jsp.html
 
http://library.maribyrnong.vic.gov.au/info.html
 
http://www.openroad.vic.gov.au/
 
http://www.w3.org/Talks/1999/0830-tutorial-unicode-mjd/
 
http://babel.uoregon.edu/Yamada/fonts.html
 
http://www.yarranet.net.au/aceweb/lote/notesw95/multi.html
 
http://www.yarranet.net.au/aceweb/lote/notesw95/papers.html
 
http://babel.alis.com:8080/
 
http://vancouver-webpages.com/multilingual/howto.html
 
http://httpd.apache.org/docs/content-negotiation.html
 
http://members.ozemail.com.au/~andjc/papers/cn99.html


excellent links to internationalization issues

2001-06-05 Thread Jonathan Asbell



Links to developing internationalized 
websites
 
Cheers
 yarranet.net.au - papers on multilingual web publishing.url
 cs.uu Programming for Internationalization FAQ.url
 developerWorks - Harnessing internationalization.url
 IBM International Text in JDK 1.2.url
 IBM java classes for Unicode.url
 Java Byte Encodings and Strings.url
 Javaworld - Internationalize JSP-based Websites.url
 Maribyrnong - multilingual ibrary Services.url
 Open Road - multilingual resource site.url
 w3c & alis study on internationalization - August 1999.url
 Yamada - Font Archive.url
 yarranet.net.au - Making a multilingual web site.url
 acoin i18n Internationalization Mailing List.url


question about Action Forwards in struts-config

2001-06-05 Thread Jonathan Asbell



I have boiled down action forward to a few exact 
situations.  I would only want to do any of the following 
situations:
1) take me back where I was
2) take me back to where I was trying to 
go
3) take me to a specific page
4) take me to a default page
 
I dont believe there is currently a neat and clean 
way of describing this in the struts-config.  Maybe there doesnt need to be 
for things like "where I was trying to go" and "where I was".  I am just 
looking for some clarity on the issues and what/why the implementation is what 
it is currently is


Re: input in XML config

2001-06-08 Thread Jonathan Asbell

I agree, but was really just pointing out that the input value is not
useful.  In some ways its outright misleading.

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 7:23 AM
Subject: Re: input in XML config


> As it stands, the "input" property in the Action Mapping is (4) a
> default page. It is not meant so much to represent where the input
> came from, but where to go to get more, so the ActionServlet knows
> where to bounce the user if ActionForm validate fails.
>
> For more complex needs, you can reserve validation for the Action
> itself, where you can choose among multiple forwards.
>
> I agree that we need more flow control, especially to do things like let
> users login in from all over the place and then get them back to
> whereever they were, or interpose a standard confirmation dialog and
> then forward on to another action, or go off and look up a related value
> and then continue adding a new record.
>
> But none of these are ActionForm validate issues.
>
> I believe the core problem here may be trying to do business logic or
> other complex validations in the ActionForm rather in than the Action.
> ActionForm validation is great for simple, domain-type validations. But
> any validation that causes a problem here should be performed in the
> Action instead where there is more "elbow room".
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
> Jonathan wrote:
> >
> > I for one dont even understand the value in the "input value" parameter.
> > There could be MANY pages that got you to the page you are on.  The
"input"
> > value just makes one possible origin available for you to have as a
return
> > target should things go fowl.  I had been saying on this discussion that
> > there should be more or less 4 different destinations:
> > 1) where you came from (referrer, or if there is no referrer a default
> > page...see below)
> > 2) where you were originally going when you were interrupted
> > 3) a specific page - (can be success or failure page or could be the
first
> > page in a form)
> > 4) a default page
>




uploading file requires immediate serialization location?

2001-06-09 Thread Jonathan Asbell



Hello all.
I am just trying to understand an aspect of a 
multipart request.  When you submit after using an input of type "file", do 
you have to provide an immediate location for the file to be serialized to, or 
can you store it in a java object (in a bean's field) as a binary object until 
you are ready to serialize it.  The reason is that I want to hold a jpeg in 
a bean until the person completes the last page of the form, and THEN serialize 
it.
 


Re: uploading file requires immediate serialization location?

2001-06-09 Thread Jonathan Asbell

Hello Martin.  So is it POSSIBLE to save binary data in a bean?  What does
struts do?  These are my real questions.  If I have a form which besides
fields, has an uploaded file, how does the bean actually handle the file?
Is there a conceptual step by step you can give me.  How does the ActionForm
save (and validate) the binary data sent via input type "file".


- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan Asbell" <[EMAIL PROTECTED]>
Sent: Saturday, June 09, 2001 10:55 PM
Subject: Re: uploading file requires immediate serialization location?


> Internally to Struts, multipart handling is provided through an interface,
> MultipartRequestHandler. In Struts 1.0, the only supplied implementation
of
> this interface is DiskMultipartRequestHandler, which, as you might expect,
> writes "file" parts to disk as it encounters them.
>
> Struts does allow you to configure the multipart handler to use, by
> specifying the class name in the multipartClass init-param for your web
app.
> This allows you to provide your own implementation if you want to
(although
> this is no small task).
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Jonathan Asbell" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, June 09, 2001 6:39 AM
> Subject: uploading file requires immediate serialization location?
>
>
> Hello all.
> I am just trying to understand an aspect of a multipart request.  When
> you submit after using an input of type "file", do you have to provide
> an immediate location for the file to be serialized to, or can you store
> it in a java object (in a bean's field) as a binary object until you are
> ready to serialize it.  The reason is that I want to hold a jpeg in a
> bean until the person completes the last page of the form, and THEN
> serialize it.
>
>
>
>




Missing configuration resource for path /WEB-INF/struts-config.xml

2001-06-10 Thread Jonathan Asbell



I am not sure why all of a sudden I am getting this 
Exception on startup
=
Call 
org.apache.struts.action.ActionServlet.addServletMapping(action/java.lang.String,*.do/java.lang.String)javax.servlet.UnavailableException: 
Missing configuration resource for path 
/WEB-INF/struts-config.xml    at 
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316)    
at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)    
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
=
 
 If you see the ActionServlet code below, I am getting 
"/WEB-INF/struts-config.xml" as the value for the handle "value", yet  am 
getting null for the value of the handle 
"input".  For some reason it is unable to get the 
"/WEB-INF/struts-config.xml" resource as a stream
 
 
 // Initialize the context-relative path to 
our configuration resources value = 
getServletConfig().getInitParameter("config"); if (value != 
null) config = value; if (debug >= 
1) log(internal.getMessage("configInit", 
config));
 
 // Acquire an input stream to our 
configuration resource InputStream input = 
getServletContext().getResourceAsStream(config); if (input == 
null) throw new 
UnavailableException  (internal.getMessage("configMissing", 
config));


RE: Missing configuration resource ..(Forget-it) - deleted tmp war

2001-06-10 Thread Jonathan Asbell




RE: Missing configuration resource ..(Forget-it) - 
I deleted tmp war and all seems ok


Re: uploading file requires immediate serialization location?

2001-06-10 Thread Jonathan Asbell

Martin, you seem to understand this subject well, so let me take a shot and
tell me if I am correct:

A multi-part request is a request, but a different one.  That is, with a
regular request things have been abstracted for us nicely with
"getParameter" etc., but a request submitted as multipart is not handled
nicely for us by the servlet spec and is a whole different animal.  This
type of request needs to be handled uniquely (though I dont understand why
the servlet spec does not have standard abstractions for it), because it may
contain binary non-text content accompanied by regular content.  In such a
request we need to examine the sections in the header and parse for certain
values we are expecting to separate out the regular text values submitted
from the binary parts, and then handle the binary parts.

Things I still dont get:
In all packages I have examined that handle multipart requests, there is
always a notion of looking for the line ": ", then looking for the blank
line after that, and then reading in binary values that follow the blank
line up until the "boundry" which is a String in a known format (see link
below).  What I dont understand is what are our options in handling this
binary stuff which is not text.  Most packages I have seen write it to a
file.  I'm not sure if there is a way to save a binary object at all, let
alone save it in a filed value in a bean.  How do you store a binary object
in a field?

==
REFERENCE
==
For those interested see this article:
www.onjava.com/lpt/a//onjava/2001/04/05/upload.html
Available servlet packages http://www.servlets.com/cos/index.html



- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: "Jonathan Asbell" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 10, 2001 3:01 PM
Subject: Re: uploading file requires immediate serialization location?


> Good question. What you are really asking is "what does the 
tag
> do?".
>
> Struts will generate an  tag, where the value of
the
> 'name' attribute is taken from the 'property' attribute of your

> tag. It will also generate a 'value' attribute. Looking at the source
code,
> it seems that the valueof the 'value' attribute will be the result of
> calling toString() on the FormFile object. Since that object doesn't
> override toString(), the result will be nothing useful. On the other hand,
> browsers usually ignore the 'value' attribute anyway.
>
> At this point, the original uploaded file is still on the disk, and will
> remain there until the form is resubmitted. Then it will be deleted as a
> part of setting up for parsing the new multipart data.
>
> Hope this helps.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Jonathan Asbell" <[EMAIL PROTECTED]>
> To: "Martin Cooper" <[EMAIL PROTECTED]>
> Sent: Sunday, June 10, 2001 5:47 AM
> Subject: Re: uploading file requires immediate serialization location?
>
>
> > Great explanation Martin. Thank you.  So what you really have said is
that
> > the stream contents gets turned into a FormFile object.  Ok.  Now the
big
> > question.  You know when a form is not valid it gets sent beack to the
> > client as strings which pre-populate the form fields.  How will this
occur
> > in the case of a file input?
> >
> >
> > - Original Message -
> > From: "Martin Cooper" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; "Jonathan Asbell"
> <[EMAIL PROTECTED]>
> > Sent: Sunday, June 10, 2001 12:20 AM
> > Subject: Re: uploading file requires immediate serialization location?
> >
> >
> > > Let me see if I can describe the process.
> > >
> > > 1. Check to see if the request should be treated as multipart (i.e.
> > content
> > > type is multipart/form-data and method is POST). If not, carry on as
> > normal.
> > > 2. Find the multipart handler or instantiate one, set it on the form
> bean,
> > > and call it to handle the request.
> > > 2a. Iterate over the fields (parts) in the request.
> > > 2a1. If the current part is not a file, store it as a String.
> > > 2a2. If the current part is a file (according to the
Content-Disposition
> > > header), create a new file in the temp directory, stream the content
of
> > the
> > > part to that file, create a new object which implements FormFile, and
> > store
> > > the file data in it.
> > > 2b. Turn the set of fields into something that looks like regular
> request
> > > parameters.
> > > 3. Populate the ActionForm i

Mixing a multipart form with beans

2001-06-10 Thread Jonathan Asbell



If I have a 5 page "wizard" (five consecutive 
form pages) and one bean, where the first three forms are regular requests and 
the fourth and fifth are each multipart forms, how do I use a bean with these 
pages?  Do I:
1) fill bean with the form values from page 1,2 and 
3 ?
2) then for the multipart forms on the last 2 pages 
fill the bean with the regular String values while simultaneuosly writing the 
file to disk but dont submit the bean filled with values until the last 
page?
 
Should I bother setting the "name" value in the 
bean for the form input of the file?  Do I need to do any validation for 
the file item?
 
The way I see it is that there are request values 
that I need to get from the request which are NOT binaries, and I need include 
them in the bean.  However, I am guessing that I should write the file as 
soon as possible to disk and NOT store it in session.  The question remains 
as to exactly when I am submitting the bean and its values.  At the same 
time that I am writing the file to disk?  Eariler? 
Later?


Re: uploading file requires immediate serialization location?

2001-06-10 Thread Jonathan Asbell

So do you simultaneously write to a file while reading a String parameter
when you process a form?  What parts of the multipart request do we save in
the bean, and in what scope?

- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan Asbell" <[EMAIL PROTECTED]>
Sent: Monday, June 11, 2001 1:23 AM
Subject: Re: uploading file requires immediate serialization location?


> Yes, I think you've got it. Just to be clear, though, when you say "we
need
> to examine the sections in the header ...", the "we" here is Struts - you
> don't need to do anything in your application. Struts makes getParameter()
> et all work for multipart requests as well as regular requests.
>
> What you are seeing in the packages you've looked at is the parsing of a
> MIME part. The fields in a multipart/form-data request each conform to the
> specification for a MIME part, and they are separated by a boundary, which
> is a line containing a pattern defined in a header at the top of the
> request.
>
> Each MIME part consists of a sequence of MIME headers, followed by a blank
> line, followed by the data for that MIME part, known as the body. A MIME
> header takes the form "header-name: value" - for example, "Content-type:
> text/plain". The body is just a bunch of data that conforms to the
> statements made about it in the headers.
>
> Every field in a multipart request is encoded this way. So where a regular
> query using GET might contain a query string like this:
>
> ...&author=Martin&...
>
> a multipart request would represent the same query parameter like this:
>
> -0123456789--
> Content-disposition: form-data; name="author"
>
> Martin
> -0123456789--
>
> For a file upload, the difference is only that the Content-disposition
> header will include a file name, and the data can be binary if necessary.
>
> When a multipart handler processes a request, it is reading the data from
an
> input stream provided by the container. Typically, for regular query
> parameters, it will store the value in a hash table. For file parameters,
it
> will store the data in a file and retain information about that file. The
> Struts implementation uses the FormFile interface to provide access to
that
> information.
>
> A multipart implementation could do whatever it wanted to with the data
> provided from a file upload. Although the Content-disposition header may
> specify a file name, there is no requirement to store that data as a file.
> One implementation that would make sense would be to define a size
> threshold, and store uploaded objects below that size in memory, while
> writing larger ones to disk.
>
> Regarding form beans and binary data, there is no reason why a field in a
> form bean cannot be a byte array. However, by itself that is not very
> useful, hence the FormFile interface. If you'll notice, that interface
does
> in fact have a getFileData() method, which will give you the uploaded data
> as a byte array. In the current implementation, what that actually does is
> load the contents of the file into memory and hand you back that memory.
And
> there you have binary data in a form field.
>
> Hope this helps.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Jonathan Asbell" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 10, 2001 1:19 PM
> Subject: Re: uploading file requires immediate serialization location?
>
>
> > Martin, you seem to understand this subject well, so let me take a shot
> and
> > tell me if I am correct:
> >
> > A multi-part request is a request, but a different one.  That is, with a
> > regular request things have been abstracted for us nicely with
> > "getParameter" etc., but a request submitted as multipart is not handled
> > nicely for us by the servlet spec and is a whole different animal.  This
> > type of request needs to be handled uniquely (though I dont understand
why
> > the servlet spec does not have standard abstractions for it), because it
> may
> > contain binary non-text content accompanied by regular content.  In such
a
> > request we need to examine the sections in the header and parse for
> certain
> > values we are expecting to separate out the regular text values
submitted
> > from the binary parts, and then handle the binary parts.
> >
> > Things I still dont get:
> > In all packages I have examined that handle multipart requests, there is
> > always a notion of looking for the line ": "

Re: uploading file requires immediate serialization location?

2001-06-10 Thread Jonathan Asbell

You wrote... "The uploaded data is stored in a temporary file somewhere on
disk.The bean is in either request or session scope. If the bean
goes away, then so does the file that holds the uploaded data."

I thought you said the file was written to disk?  Thus the binary is not in
the bean.  Or is it that the FormFile has all this data and IT is in the
bean.  So I end up with a file on disk that is in a state of not be
associated with anything yet, and whos filename and input field names I have
lost when the bean went away.  Is that it?  If we are keeping the FormFile
in the bean, in the session and the FormFile indeed does contain the binary,
than this is a bad thing.  We should at theleast kill the binary from the
FormFile object so we CAN safely put it in the session.  (Dont know if I
mentioned by weblogic croaks/freaks if the session has too much "k" in it.

- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan Asbell" <[EMAIL PROTECTED]>
Sent: Monday, June 11, 2001 1:55 AM
Subject: Re: uploading file requires immediate serialization location?


> String parameters are not written to a file. Only the bodies of file
upload
> parts are written to disk, and each one to a separate file. The files are
> written as the input stream (i.e. the request) is processed.
>
> Let's say your form has two fields, a textarea called 'myText' and a file
> input called 'myFile'. After you submit it, and Struts has populated your
> form bean, you will have:
>
> 1) The text from the textarea field is stored in the bean's 'myText'
> property as a String.
> 2) The uploaded data is stored in a temporary file somewhere on disk.
> 3) The 'myFile' property on your bean, which has type FormFile, contains
> information about the uploaded data (e.g. file name, content type, etc.).
>
> The bean is in either request or session scope, as you defined it in your
> struts-config.xml file. If the bean goes away, then so does the file that
> holds the uploaded data.
>
> Hope this helps.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Jonathan Asbell" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 10, 2001 10:48 PM
> Subject: Re: uploading file requires immediate serialization location?
>
>
> > So do you simultaneously write to a file while reading a String
parameter
> > when you process a form?  What parts of the multipart request do we save
> in
> > the bean, and in what scope?
> >
> > - Original Message -
> > From: "Martin Cooper" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; "Jonathan Asbell"
> <[EMAIL PROTECTED]>
> > Sent: Monday, June 11, 2001 1:23 AM
> > Subject: Re: uploading file requires immediate serialization location?
> >
> >
> > > Yes, I think you've got it. Just to be clear, though, when you say "we
> > need
> > > to examine the sections in the header ...", the "we" here is Struts -
> you
> > > don't need to do anything in your application. Struts makes
> getParameter()
> > > et all work for multipart requests as well as regular requests.
> > >
> > > What you are seeing in the packages you've looked at is the parsing of
a
> > > MIME part. The fields in a multipart/form-data request each conform to
> the
> > > specification for a MIME part, and they are separated by a boundary,
> which
> > > is a line containing a pattern defined in a header at the top of the
> > > request.
> > >
> > > Each MIME part consists of a sequence of MIME headers, followed by a
> blank
> > > line, followed by the data for that MIME part, known as the body. A
MIME
> > > header takes the form "header-name: value" - for example,
"Content-type:
> > > text/plain". The body is just a bunch of data that conforms to the
> > > statements made about it in the headers.
> > >
> > > Every field in a multipart request is encoded this way. So where a
> regular
> > > query using GET might contain a query string like this:
> > >
> > > ...&author=Martin&...
> > >
> > > a multipart request would represent the same query parameter like
this:
> > >
> > > -0123456789--
> > > Content-disposition: form-data; name="author"
> > >
> > > Martin
> > > -0123456789--
> > >
> > > For a file upload, the difference is only

Displaying data retrieved from a database

2001-06-11 Thread Jonathan Asbell



I was interested in how you all were displaying 
data retrieved from a database.  My notion is that in your Actions 
perform() method you will make calls and get results.  But where do you put 
the results?  Do I save the data to a bean which I pass in the request to a 
waiting Tag class on the page I will forward to, and have that Tag class iterate 
through the beans data? This means I have to make Tag classes to read 
in passed beans. 
 
How are you all doing this in general.  I am 
very interested.
 
Jonathan


Re: Concepts in working with multipart request

2001-06-11 Thread Jonathan Asbell



Thanks Mike :^)

  - Original Message - 
  From: 
  SCHACHTER,MICHAEL 
  (HP-NewJersey,ex2) 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, June 11, 2001 10:15 
PM
  Subject: RE: Concepts in working with 
  multipart request
  
  Jonathan,
   
   
   > Hello 
  all.
   > I wanted to 
  know if I am able to use the MultipartRequestWrapper object by itself.  
  
   > That is, can I 
  store MultipartRequestWrapper objects in a bean. 
   
  I would definately not recommend 
  it.  The MultipartRequestWrapper object is 
  something that
  should be 
  used internally to Struts, to work around some existing issues 
  between
  normal and multipart 
  requests.  Also, that class is definately going to change to 
  extend
  javax.servlet.http.HttpServletRequestWrapper when 
  Struts adopts the Servlet 2.3 spec.
   
   > My purpose is 
  to temporarily store a binary and its file name in a bean until 
  > the final form page 
  when the user  submits   the whole "kit and 
  kaboodle". 
   
  Instead of doing this, 
  you'd probably just want to stick to using an ActionForm bean that 
  has
  a FormFile 
  property.  The FormFile interface should suit your needs well, 
  as it has a getFileName()
  method and methods to 
  retrieve the data written to a temporary file after 
  uploading:
   
  public 
  class MultipageForm extends ActionForm 
{
   private FormFile 
  theFile;
   
   public void setTheFile(FormFile file) 
  {
    this.theFile 
  = file; 
   }
   public FormFile getTheFile() 
  {
    
  return theFile;
   }
  }
   
   > Part of the 
  problem is that I dont understand what is going on. It looks like the 
  request keeps the following:
   > "name" property 
  representing the form field name
   > "value" 
  property representing the String path of the file you 
  uploaded
   > some binary 
  Stream data representing the file 
   
  Again, don't pay much 
  attention to the MultipartRequestWrapper class, concentrate on creating 
  an
  ActionForm bean 
  that has a org.apache.struts.upload.FormFile property representing your 
  file, and
  normal String 
  properties representing your form data, just as you would normally create a 
  non
  multipart 
  form.
   
   > I realy have no 
  idea, and I am looking around for answers but am coming up 
  empty.
   > Can someone sum 
  up what is happening here, what the request contains, what values the 
  request 
  > works with, and 
  what   are the requirements. 
   
  Martin Cooper summed 
  this up nicely in another thread about uploading, but I'll go 
  over it anyway:
   
  1) Request comes in, 
  Struts goes to populate the form (BeanUtils.populate()) discovers 
  that the
      
  content type of the request 
  is "multipart/form-data"
  2) Struts goes to 
  populate the form, and creates a MultipartRequestHandler instance to 
  handle
      the multipart request.  
  MultipartRequestHandler is an interface, the implementation can 
  change
      at will and can be specified as an 
  init-param for ActionServlet, or as an ActionServlet 
  property
      in 
  struts-config.xml
  
  2a) In the 
  implementation that comes with Struts, the multipart form data is read as 
  follows:
    Read the 
  data,
      if it's a 
  string parameter, grab it's value and put it in a Hashtable for later 
  use
      if it's a 
  file, read the file with a BufferedInputStream and store the data in a 
  temporary
      file, then 
  wrap it in a FormFile implementation 
  (org.apache.struts.upload.DiskFile)
      and hand 
  it back to BeanUtils (next step)  
  3) 
  BeanUtils.populate() uses the interface methods in MultipartRequestHandler to 
  grab the properties
      that were retrieved from the 
  normal multipart request, the populates your ActionForm bean with 
  the
      relevant 
  data.
  4) The 
  Action is executed, and code in there manipulates the file according to 
  whatever you want to
      do with it, for example, say we 
  wanted to take the previous form bean (above) and use it in the 
  action:
      
  public class 
  UploadAction extends Action {
      public ActionForward 
  perform(ActionMapping 
  mapping, ActionForm 
  form, 
  HttpServletRequest 
  request, 
  HttpServletResponse response) {
     
  FormFile theFile = ((MultipageForm) form).getTheFile();
     
  String filename = theFile.getFileName();
     //and 
  so on...
  }
   
  Hope this helps, also consult that long thread 
  called
  "uploading files requires immediate serialization?", 
  Martin Cooper does
  a damn good job of answering questions about 
  this.  Thanks again Martin...
   
  - Mike
   


Re: Handling Multipart forms (sort of Wizard)

2001-06-12 Thread Jonathan Asbell

Hello Mike. Cant this be done neatly with one action form?  I wouldnt want
to create 3 form beans because if the designers move some form fields to
another page, than I have to change the beans effected.  You know what I'm
sayin?

- Original Message -
From: "Michael Mok" <[EMAIL PROTECTED]>
To: "'suhas'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 4:18 AM
Subject: RE: Handling Multipart forms (sort of Wizard)


> Hi Suhas
>
> Good question. I missed out some steps for the second option.
>
> You will need to create three form actions to process each of the form
> beans. The "mother" bean is stored in the session and is accessed and
> updated in each action. Hence at the end of the logical process, the
> "mother" bean has all the values for your 3 forms.
>
> Hope it makes sense.
>
> Regards
>
> Michael Mok
> www.webappcabaret.com/normad
>
>
> -Original Message-
> From: suhas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 12 June 2001 16:13
> To: [EMAIL PROTECTED]
> Subject: Re: Handling Multipart forms (sort of Wizard)
>
>
> In the below 2nd option  - what is the need of the "mother" bean when u
> already have separate beans for each jsp
>
> Suhas
> - Original Message -
> From: Michael Mok <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 12, 2001 8:51 AM
> Subject: RE: Handling Multipart forms (sort of Wizard)
>
>
> > Sandeep
> >
> > Let me try. See if the solution proposed makes sense as the techniques
> were
> > discussed before.
> >
> > 1) Include a "PageNumber" attribute into your Form bean. In your JSP,
> store
> > the PageNumber as a hidden attribute. In your form.validate() method,
> > determine which page is passed then validate the appropriate fields. For
> > this to work, you will need maintain your form bean in the session
object
> > (ie set the scope in your struts-config.xml file).
> >
> > 2) Create three form beans (ie one for each JSP) and create a "mother"
> bean
> > that has all the attributes of the three form beans. In this case, each
> form
> > beans can perform its validate method() and the form action class can
copy
> > each form properties to the "mother" bean using
PropertyUtil.copyProperty
> > method. Note you will need to store the "mother" bean into the session
> > object.
> >
> > Regards
> >
> > Michael Mok
> > www.webappcabaret.com/normad
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, 12 June 2001 15:32
> > To: [EMAIL PROTECTED]
> > Subject: Handling Multipart forms (sort of Wizard)
> >
> >
> >
> >
> >
> > Hello All,
> >
> > I am using mulipart forms for adding an employee information.
> > In this I have 3 forms namely, emplEducation, emplExperience,
emplGeneral
> in
> > separate JSPs.
> > In this case, I am using only one form bean for all these JSPs and only
> one
> > action class.
> >
> > My problem is how to validate the Form bean after each page submission:
>
> --
> --
> > 
> >
> > I know the validation can be done in the form bean using validate()
method
> > or in
> > the action class
> >
> > But, if user filled emplEducation form and press "Next", to go to
> > emplExperience,
> > how do I validate only those form bean fields related to emplEducation
and
> > not
> > the others till they are entered by user??
> > Is there any straight forward strategy for handling this??
> >
> > - Sandeep
> >
> >
> >
> >
> >
> >
> >
> >
> >
>




Re: Handling Multipart forms (sort of Wizard)

2001-06-12 Thread Jonathan Asbell

Darryl, you need to get away from the pc a little more
;^>

- Original Message -
From: "Darryl Pentz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 6:19 AM
Subject: RE: Handling Multipart forms (sort of Wizard)


> Thanks, that'll be great. Look forward to the post. Ditto on
> documentation... one of those necessary evils in life you know,
> like women. ;)
>
> -Original Message-
> From: Andrew Steady [mailto:[EMAIL PROTECTED]]
> Sent: 12 June 2001 12:09
> To: [EMAIL PROTECTED]
> Subject: RE: Handling Multipart forms (sort of Wizard)
>
>
> Hi,
>
> I'm working on the documentation now and feel it would only be fair to
> contribute some of these diagrams back to the struts community. It will
> probably take me a couple of days to get it sorted though. I hate
> documentation, grg.
>
> Cheers,
>
> Andy S
>
> p.s. I think it has more to do with my style of writing than your lack of
> smartness - did I mention that I hate documentation?
>
>
>
>
> [EMAIL PROTECTED] on 12/06/2001 11:09:16
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED]
> cc:(bcc: Andrew Steady/Swindon01/Domino01/Kinesis)
> Subject:  RE: Handling Multipart forms (sort of Wizard)
>
>
>
>
> This sounds like a very elegant though sophisticated design. Any way you
> could post some diagrams or something? I don't know, GIF's of object
models
> etc. Or is there a URL you could direct us to?
> Just curious because I wasn't smart enough to understand everything from
> your description.
> - Darryl
> -Original Message-
> From: Andrew Steady [mailto:[EMAIL PROTECTED]]
> Sent: 12 June 2001 11:34
> To: [EMAIL PROTECTED]
> Cc: Ben Radford
> Subject: RE: Handling Multipart forms (sort of Wizard)
>
> Hi,
> Our solution, using struts, is a mutli-page and multi-channel solution.
> It works on the principle of page numbers and has only one action per
> wizard regardless of the number of pages involved.
> There is a base class form which has a validate method that can validate
> any form in a generic method, validating only the fields on the current
> page, and after completion  of the wizard does a "finalValidate" check to
> make sure nothing remained unvalidated (this is necassary due to the
> dynamic way in which the page by page validation is executed). In our
> system we have a data dictionary most fields represent a field in the data
> dictionary - this link to the data dictionary which performs the
validation
> for that particular type of field e.g. a PostCode validator. The data
> dictionary also returns the possible values for fields which are of a
> select variety - the labels are then looked up based on the current
> language, the field type and the value. If a field is not representing a
> data dictionary member a localValidator must be written in the form object
> name e.g. validatePostCode. CrossFieldValidations are executed in a
similar
> manner and we have added functionality to ensure crossFieldValidations are
> run at the correct time (one of the tough bits!).
> The base class Form (which extends ActionForm) is then subclassed, one per
> wizard, the member field objects are defined in the initialise method, the
> fields have objects which have attributes and methods as necassary to
> complete the functionality. The getters and setters in the wizard form
> fetch the correct field from the collection and set/get the value to
return
> to the struts tag libraries/other code.
> Each form is then sublassed once per channel (Wap, HTML and iDTV - all of
> which we have working). The subclass specifies to the field objects which
> page each field is on for that particular channel, this enables the
> validation to work correctly and also means business validation errors
from
> the EJB container after wizard completion and submission can be directed
to
> the correct page for display. The sublassed channel specific form can add
> extra fields and specify which page they lie on (or set a field to be
> internal). An example of this is that the base class of a transaction may
> contain a single date field. On the Web channel this is actually 3 fields
> (day, month, year) on the Wap channel this is just a selection of
> today/tomorrow etc. As each page is submitted a method on the channel
> specific sublass called mapData is called - in the Web channel this maps
> the 3 fields into the 1 date field, on the Wap channel it maps todays date
> or tomorrows date into the base class single date field. The validation is
> then run and any errors are displayed by including the error tag to the
> base class date field (although a mapError method could be called to map
it
> to the year field in the web channel etc.). When a form is prepopulated
> from stored records before the user begins to complete it a mapInitialData
> method is called - in the web channel this would pre-populate the
> day/month/year fields based upon the date value in the base class - the
> reverse of mapData. We have many 

Re: errors during parsing"" struts-logon example-www.bluestone.com

2001-06-13 Thread Jonathan Asbell



I had a similar problm that went away after I 
deleted the temp war files (the servlets that are generated from the 
jsp)

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, June 13, 2001 4:56 
  AM
  Subject: errors during parsing"" 
  struts-logon example-www.bluestone.com
  Hi, i have been developing the struts-trail examples from www.bluestone.com/scritps/ 
  and a one stage everything was working albeit not now . The classpath 
  for my form bean etc (struts-bbnpa/WEB-INF/classes/logon/logonForm.java) 
  struts-bbnpa is my wep app i am aware that the .java are the 
  packages . I created a Action Class under the package logon , thus has 
  this package to be beneath WEB-INF or a level above it as i am 
  recieveing errors during parsing. 
  This is the current situation below i believe that is should just be named 
  package logon please correct me. package 
  struts-bbnpa.WEB-INF.classes.logon; -- The views expressed 
  by the sender of this message don't necessarily represent those of Brecon 
  Beacons National Park Authority. This message is intended for the 
  addressee(s) only and is sent in confidence; if you receive it in error, 
  please can you let us know (at [EMAIL PROTECTED]) and then destroy all 
  copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn 
  adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges 
  yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i 
  hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a 
  fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch 
  bob copi.   


Re: Form-based Authentication

2001-06-13 Thread Jonathan Asbell

Hi Jon.  i was reading about this form based auth, and I wondered if you
could explain some things to me.  Is form based auth just a combination of
an element declared by the web.xml and a line or two in the java code?


- Original Message -
From: "Jon.Ridgway" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 4:51 AM
Subject: RE: Form-based Authentication


> Hi All,
>
> Form based auth is something that I have just been looking at, so I
thought
> I'd add my two pennies worth.
>
> My login form is using struts html, bean and template tags (no html:form)
> and all appears ok. My template has an adapted version of the checkLogin
tag
> provided with the struts-example. My adapted version just checks that a
user
> attribute is in the session and creates one if it is not using the
> j_username and j_password to look the users' details up in my db.
>
> Question: can I be sure that *all* containers will put a j_username and
> j_password attribute in the session, like tomcat does?
>
> Jon.
>
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: 13 June 2001 02:05
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Form-based Authentication
>
>
>
> On Tue, 12 Jun 2001, Abraham Kang wrote:
>
> > Hi Craig,
> >
> > Thanks for the clarification.
> >
> > I was wondering if you knew of any other way to do pre-processing
> > before being authenticated and post-processing after authentication
> > when using the form based authentication.
> >
> > Would filters work here?
> >
>
> Maybe.
>
> The reason that the spec is so specific about "j_security_check" is to
> provide containers lots of leeway in *how* they implement form based login
> -- as long as they conform to the requirements that are listed, they can
> do what they want.  For example, Tomcat 4 recognizes the
> "j_security_check" as the clue it needs to replay the *original* request,
> so that the "j_security_check" request itself never goes through the
> filter chain.
>
> You'd be a lot better off in a servlet 2.3 environment by using
> application event listeners to notice session creations, so that you can
> (for example) mark the session as needing some special handling on the
> next incoming request -- that, of course, being the only time you know
> who the authenticated user really is.  Of course, in a nice MVC framework
> (like Struts :-), the actual processing to be performed can be easily
> delegated to the controller servlet.
>
> > Sincerely,
> > Abraham
> >
>
> Craig McClanahan
>
>
> > > -Original Message-
> > > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, June 12, 2001 4:59 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: Form-based Authentication
> > >
> > >
> > >
> > >
> > > On Tue, 12 Jun 2001, Abraham Kang wrote:
> > >
> > > > RE: Form-based AuthenticationHi Jason,
> > > >
> > > > I should have been clearer.
> > > >
> > > > The only time that you do not want the login-form to specify
> > > > "j_security_check" as its action is when you want to do some special
> > > > preprocessing before the user is authenticated.  By forwarding
> > > to a servlet
> > > > (I haven't tried this with an Action but it should work) you can do
> your
> > > > preprocessing in the servlet and then do a
> > > requestDispatcher.forward( ) to
> > > > j_security_check.  This will allow you to do pre-processing and take
> > > > advantage of the containers authentication realm.
> > > >
> > >
> > > WARNING:  Although it might be supported by some containers, you are
> *not*
> > > guaranteed by the servlet spec that you can portably play that sort of
a
> > > game.  The spec clearly states that the form login page *must* have an
> > > action of "j_security_check".  (I haven't tried it, but I'm pretty
sure
> > > your technique would not work on Tomcat.)
> > >
> > > > My guess is you are currently doing authentication against
> > > a database
> > > > table.  If you are using WebLogic you can use the DBMSRealm.  This
> will
> > > > probably mean you will need to add some tables to support the roles
in
> > > > WebLogic but now you don't need the authentication code in your
> actions.
> > > > The container manages access to protected resources.  You don't
> > > have to have
> > > > any scriptlets at the top of your pages as long as the regular
> > > expression in
> > > > the  of the  element of your
web.xml
> > > > matches all of your protected resources.
> > > >
> > >
> > > Tomcat supports a similar mechanism -- you can configure lookup of
users
> > > in a flatfile, in a database, or in a directory server.  Each
container
> > > will provide it's own mechanisms for defining how and where users and
> > > roles can be stored.
> > >
> > > > --Abraham
> > >
> > > Craig McClanahan
> > >
> > >
> >
> >
>




Re: help with package struts-classpath

2001-06-13 Thread Jonathan Asbell



should be
 
for UNIX/LINUX
/struts-bbnpa/WEB-INF/classes
or
for Windows
c:\struts-bbnpa\WEB-INF\classes
 

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, June 13, 2001 8:26 
  AM
  Subject: help with package 
  struts-classpath
  Hi, i have checked my struts-config and i noticed that the 
  action mappings reads below. Thus my classpath  is 
  struts-bbnpa/WEB-INF/classes/org/breconbeacons/it/class.java 
  struts-bbnpa the name of my webapp. 
  I have declared  package org.breaconbeacons.it ;    
  //  top of java classes page       
                     
     
  type="org.apache.struts.actions.AddFormBeanAction"/> 
         
  type="org.apache.struts.actions.AddForwardAction"/> 
         
  type="org.apache.struts.actions.AddMappingAction"/> 
         
  type="org.apache.struts.actions.ReloadAction"/> 
         
  type="org.apache.struts.actions.RemoveFormBeanAction"/> 
         
  type="org.apache.struts.actions.RemoveForwardAction"/> 
         
  type="org.apache.struts.actions.RemoveMappingAction"/>   
     
  <--     

Re: General Struts & J2EE question

2001-06-13 Thread Jonathan Asbell

Ted, One thing I am not understanding is why we are bouncing requests all
over using various servlets, as in the case of validation.  What are the
consequences and or benefits of one servlet triggereing another etc.  It
seems as though this can create confusion because you dont know what is
happening.  That is, you could end up being bounced all over the place from
servlet to servlet beforwe coming to a rest, and you may or may not know
what exactlly transpired.

Jonathan


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 5:39 PM
Subject: Re: General Struts & J2EE question


> The best practice is to first validate the incoming data entry using the
> Strut's ActionForm beans. There is a Validation servlet available that
> automates much of this using regular expressions, and generates checks
> using both client-side Javascript and server-side Java code.
>
> Then, the Strings from the ActionForms can then be passed to your
> Enterprise Beans. Depending on how your EB's are setup you can do this
> with
>
> 1. Data conversion methods built into the Action Forms.
> 2. A generalized helper class.
> 3. Some other methods already available to you.
>
> I'm work with CachedRowSets, which handle most of the data conversions
> for me.
>
> Struts is a very good choice for a data-entry applications, given the
> limitations of HTML forms generally.
>
> I'm rebuilding the data-entry portion of an application now, and should
> be able to share most of the code next week as open source. It does not
> use J2EE directly, but does follow the same design patterns. The view
> portion of this is an online auction for a public broadcasting auction.
> Most of the items are gone (we started with over 5000), but a few dozen
> are still available at < http://data.wxxi.org/wxxi-gavel/ >. This also
> is a Struts application, though we originally transfered the data from
> another application.
>
> My biggest tip is to use templates to design many common classes at
> once. With a data-centric application, many operations are repeated for
> each table, so I'm using a boilerplate form that lets me define several
> related classes with one sweep with search and replace. (At least until
> I get around to writing a real code generator!)
>
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
> Kris Vandenberk wrote:
> >
> > Hi,
> >
> > I work in a company where 90% of all applications being developed are
mostly
> > data-entry kinda applications (so a lot of data input, validations on
that
> > data ... and readonly views of that data)
> >
> > A lot of our clients 'heard' of J2EE and they insist on using J2EE for
their
> > new applications, which isn't a bad thing, although it is quite costly
for
> > applications only used by a 100 users.
> >
> > This aside, I have a couple of questions:
> > *  what is at this moment the best practice (presentation) to develop
data
> > entry
> >applications using J2EE, is struts appropriate, or would you suggest
> >applets, ... ? or a mix, lets say applets for data entry and struts
> >based JSP for read only views ?
> > * does anyone have hands-on experience with data entry kinda
applications
> > built on struts ?
> > * metrics available ? time to develop ? compared to applets ?
> > * pitfalls ? tips ?
> >
> > thanks,
> >
> > Kris
>




Type conversions - issues on where to do them

2001-06-13 Thread Jonathan Asbell



Hello all.
I wanted to know where you are doing type 
conversion.  The reason I ask is because to some extent one may choose to 
do slightly deeper validations in the ActionForm for reasons of 
expectation.  The question remains as to the exact level of "light" 
validation we should do in the ActionForm.  From reading the list it seems 
the general consensus is to only do validation of a value's existance.  
However, where do you do type conversion then?  In the ActionForm? In the 
Action?  In the BusinessObject layer?  The issues are:
 
1) If I do it in the ActionForm and there is a 
problem in the Action, then I have to reconvert back to a String on the way 
back.;
 
2) If I do it in the Action, same problem, but also 
the argument has been brought to my attention that the ActionForm bean (although 
temporary) does not truly represent the data it contains (like when a value 
 represents a double, money, or a Date)
 
3) If I do it in the Business Layer than 
the message has gone deeper into the application than necessary which 
sacrifices performance and needless use of resources.


Re: General Struts & J2EE question

2001-06-13 Thread Jonathan Asbell

Ah.  So you are saying its just a plain class(not a servlet).  Or rather,
its not being triggered by urls, but rather by direct calls from other
classes. Or is it a servlet that is not being triggered by urls.  I am just
getting confused because it is the umteenth time I have seen these pluggable
"extensions" referred to as servlets.



- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 10:26 PM
Subject: Re: General Struts & J2EE question


> Sorry, the servlet part is really a misnomer, and is only used to load
> the validation mappings.
>
> The requests are all still handled by the ActionServlet. The server-side
> validation happens within a subclass of ActionForm. The client-side
> validation is generated by a custom tag. It snaps into the existing
> flow, and nothing bounces around.
>
> Jonathan Asbell wrote:
> >
> > Ted, One thing I am not understanding is why we are bouncing requests
all
> > over using various servlets, as in the case of validation.  What are the
> > consequences and or benefits of one servlet triggereing another etc.  It
> > seems as though this can create confusion because you dont know what is
> > happening.  That is, you could end up being bounced all over the place
from
> > servlet to servlet beforwe coming to a rest, and you may or may not know
> > what exactlly transpired.
> >
> > Jonathan
> >
> > - Original Message -
> > From: "Ted Husted" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, June 13, 2001 5:39 PM
> > Subject: Re: General Struts & J2EE question
> >
> > > The best practice is to first validate the incoming data entry using
the
> > > Strut's ActionForm beans. There is a Validation servlet available that
> > > automates much of this using regular expressions, and generates checks
> > > using both client-side Javascript and server-side Java code.
> > >
> > > Then, the Strings from the ActionForms can then be passed to your
> > > Enterprise Beans. Depending on how your EB's are setup you can do this
> > > with
> > >
> > > 1. Data conversion methods built into the Action Forms.
> > > 2. A generalized helper class.
> > > 3. Some other methods already available to you.
> > >
> > > I'm work with CachedRowSets, which handle most of the data conversions
> > > for me.
> > >
> > > Struts is a very good choice for a data-entry applications, given the
> > > limitations of HTML forms generally.
> > >
> > > I'm rebuilding the data-entry portion of an application now, and
should
> > > be able to share most of the code next week as open source. It does
not
> > > use J2EE directly, but does follow the same design patterns. The view
> > > portion of this is an online auction for a public broadcasting
auction.
> > > Most of the items are gone (we started with over 5000), but a few
dozen
> > > are still available at < http://data.wxxi.org/wxxi-gavel/ >. This also
> > > is a Struts application, though we originally transfered the data from
> > > another application.
> > >
> > > My biggest tip is to use templates to design many common classes at
> > > once. With a data-centric application, many operations are repeated
for
> > > each table, so I'm using a boilerplate form that lets me define
several
> > > related classes with one sweep with search and replace. (At least
until
> > > I get around to writing a real code generator!)
> > >
> > >
> > > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > > -- Custom Software ~ Technical Services.
> > > -- Tel 716 737-3463.
> > > -- http://www.husted.com/about/struts/
> > >
> > > Kris Vandenberk wrote:
> > > >
> > > > Hi,
> > > >
> > > > I work in a company where 90% of all applications being developed
are
> > mostly
> > > > data-entry kinda applications (so a lot of data input, validations
on
> > that
> > > > data ... and readonly views of that data)
> > > >
> > > > A lot of our clients 'heard' of J2EE and they insist on using J2EE
for
> > their
> > > > new applications, which isn't a bad thing, although it is quite
costly
> > for
> > > > applications only used by a 100 users.
> > > >
> > > > This aside, I have a couple of questions:
> > > > *  what is at this moment the best practice (presentation) to
develop
> > data
> > > > entry
> > > >applications using J2EE, is struts appropriate, or would you
suggest
> > > >applets, ... ? or a mix, lets say applets for data entry and
struts
> > > >based JSP for read only views ?
> > > > * does anyone have hands-on experience with data entry kinda
> > applications
> > > > built on struts ?
> > > > * metrics available ? time to develop ? compared to applets ?
> > > > * pitfalls ? tips ?
> > > >
> > > > thanks,
> > > >
> > > > Kris
> > >
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>




Re: Type conversions - issues on where to do them

2001-06-13 Thread Jonathan Asbell

Well, just one hitch when doing the business validation in the Action.  If
you are developing in an enterprise environment, you probably want to do
these kind of validations in a business object because, as pointed out in an
eariler thread, you may need data from the database to do this
validation/evaluation.  Better that the validation for this level all be in
one place.  In an enterprise app the Action would probably be considered
part of the web tier.  Therfore, it would not be good to mix the two tiers.
What do you Think?

By the way Ted, thank you for being so open and taking the time to offer
your perspective.  I really appreciate it and I'm sure everyone on the list
does as well.  It makes this list truly worth while. Ditto to Oleg, Martin,
Michael, Johan, Peter, Nanduri, Jon, Jeff, Hal, David, and Craig.  I have
learned alot in these 3 months.




- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 10:42 PM
Subject: Re: Type conversions - issues on where to do them


> The best practice is to perform domain validations in the ActionForm,
> like those possible with David W's validator. This means confirming that
> the String could be represented as the desired type. The original String
> captured by the ActionForm should never be altered (immutable except by
> the user).
>
> The type conversions can be handled by a helper object, which can be
> embedded in the ActionForm or elsewhere. If the conversions are handled
> by the ActionForm, the result should always be transfered to another
> property, leaving the original String intact. A good way to retrieve the
> data in this case is to have a separate accessor. So an ActionForm may
> have a getAccount() accessor and a getAccountInt() accessor, with the
> int property being set as part of the ActionForm validation. If the
> ActionForm makes it to the Action, the API contract would be that
> getAccountInt() will return a valid representation of getAccount as an
> int.
>
> Of course, the int returned may not be in a valid range, pursuant to
> some business logic. This level of validation should be perfomed in the
> Action, which can easily return the ActionForm to input if there is a
> problem. Another form of range might be a valid username and password.
>
> [ user input ] -> [ action form ] -> [ validate domain ] -> [ action ]
> -> [ validate range ] -> [ transfer to persistent storage or business
> logic beans ]
>
> Depending on the resources available, you may also prefer to do the type
> conversions within the Action. If the ActionForm validator is doing it's
> job, the conversions should not fail. Personally, I let the RowSets do
> most of my type conversions for me, which happens within the Action.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
>
> > Jonathan Asbell wrote:
> >
> > Hello all.
> > I wanted to know where you are doing type conversion.  The reason I
> > ask is because to some extent one may choose to do slightly deeper
> > validations in the ActionForm for reasons of expectation.  The
> > question remains as to the exact level of "light" validation we should
> > do in the ActionForm.  From reading the list it seems the general
> > consensus is to only do validation of a value's existance.  However,
> > where do you do type conversion then?  In the ActionForm? In the
> > Action?  In the BusinessObject layer?  The issues are:
> >
> > 1) If I do it in the ActionForm and there is a problem in the Action,
> > then I have to reconvert back to a String on the way back.;
> >
> > 2) If I do it in the Action, same problem, but also the argument has
> > been brought to my attention that the ActionForm bean (although
> > temporary) does not truly represent the data it contains (like when a
> > value represents a double, money, or a Date)
> >
> > 3) If I do it in the Business Layer than the message has gone deeper
> > into the application than necessary which sacrifices performance and
> > needless use of resources.
>




Re: Type conversions - issues on where to do them

2001-06-13 Thread Jonathan Asbell

Regarding your answer:
"Of course, you need an 'it can't happen, but it did' sort of error catch
for conversion errors when you copy the String versions of the properties to
your actual business objects, "

Are you assuming that I keep the form data as Strings until the business
layer? This was my collegue's complaint about the ActionForms because they
did not contain the "types" he was expecting, but rather just Strings. Where
are you personally doing conversions?


- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan Asbell" <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 11:01 PM
Subject: Re: Type conversions - issues on where to do them


>
> This is an interesting question.  I'll give you my take on it -- others
> will have different opinions.
>
> On Wed, 13 Jun 2001, Jonathan Asbell wrote:
>
> > Hello all. I wanted to know where you are doing type conversion.  The
> > reason I ask is because to some extent one may choose to do slightly
> > deeper validations in the ActionForm for reasons of expectation.  The
> > question remains as to the exact level of "light" validation we should
> > do in the ActionForm.  From reading the list it seems the general
> > consensus is to only do validation of a value's existance.  However,
> > where do you do type conversion then?  In the ActionForm? In the
> > Action?  In the BusinessObject layer?  The issues are:
> >
> > 1) If I do it in the ActionForm and there is a problem in the Action,
> > then I have to reconvert back to a String on the way back.;
> >
>
> That's why I advocate that properties in an ActionForm should be Strings
> instead of dates/ints/whatever.
>
> However, this is an issue that the validate() method can check, to catch
> things as early as possible.  Whether you actually save the converted
> value here or not is a compute-time-versus-memory-space tradeoff, and
> either solution is possible.
>
> > 2) If I do it in the Action, same problem, but also the argument has
> > been brought to my attention that the ActionForm bean (although
> > temporary) does not truly represent the data it contains (like when a
> > value represents a double, money, or a Date)
> >
>
> If you're using an ActionForm bean that uses validation (the default
> case), and if your validate method checks for any type conversion
> problems, then the Action can assume that the conversion will not
> fail.  Of course, you need an "it can't happen, but it did" sort of error
> catch for conversion errors when you copy the String versions of the
> properties to your actual business objects, but 99% of the time they won't
> actually get triggered.
>
> > 3) If I do it in the Business Layer than the message has gone deeper
> > into the application than necessary which sacrifices performance and
> > needless use of resources.
> >
>
> Type conversion errors should have been caught by now.  Business objects
> should deal with the native property types -- part of the role of the
> Action is to be an adapter between the String representation (used by the
> form beans) and the native representation (used by the business logic).
>
> Craig McClanahan
>
>




Re: Type conversions - issues on where to do them

2001-06-13 Thread Jonathan Asbell

As we are both being nightowls in the same timezone, let me continue with
this.  We are using a Broker.  So, in my case each Action would call the
Broker, which is our link to the enterprise layer. Also, if the business
object rejected the data, as you said, than it would pass it to the Action
but NOT up again to the ActionForm.  At that point the Action would choose a
forward with errors and data.


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 11:25 PM
Subject: Re: Type conversions - issues on where to do them


> Jonathan Asbell wrote:
> > Well, just one hitch when doing the business validation in the Action.
If
> > you are developing in an enterprise environment, you probably want to do
> > these kind of validations in a business object because, as pointed out
in an
> > eariler thread, you may need data from the database to do this
> > validation/evaluation.  Better that the validation for this level all be
in
> > one place.  In an enterprise app the Action would probably be considered
> > part of the web tier.  Therfore, it would not be good to mix the two
tiers.
> > What do you Think?
>
> The Action can be murky ground, but it is often used as the interface
> between the business tier and the Web tier. After all, they have to meet
> somewhere, yes? So, if the business object rejected the data, it would
> return it to the Action, which would hand it back to the ActionForm. You
> would not so much be doing the validation in the Action form as much as
> you would be calling the Business Object from the Action to do the
> validation.
>
> [ ActionForm ] <-> [ Action ] <-> [ Business Object ]
>
> > By the way Ted, thank you for being so open and taking the time to offer
> > your perspective.  I really appreciate it and I'm sure everyone on the
list
> > does as well.  It makes this list truly worth while. Ditto to Oleg,
Martin,
> > Michael, Johan, Peter, Nanduri, Jon, Jeff, Hal, David, and Craig.  I
have
> > learned alot in these 3 months.
>
> And before much longer I'm sure someone will be adding your name to a
> list like that, Jonathan ;-)
>
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>




Re: Iterate tag update?

2001-06-13 Thread Jonathan Asbell

Yee!
: ^ }
- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 12:42 AM
Subject: Re: Iterate tag update?


> I just checked in a change to the iterate tag which allows you to access
the
> current index as a scripting variable. If you specify the 'indexId'
> attribute, a scripting variable with the specified name will contain the
> current index (as an Integer) on each iteration. This will be available in
> the 6/14 nightly build, and also in Struts 1.0.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 13, 2001 9:36 AM
> Subject: Iterate tag update?
>
>
> >
> >
> > I have a question similar to Mark Kettner's.
> >
> > Could someone give an update on the iterate tag, and where it stands
with
> the
> > ability to get hold of the current index.
> >
> > I need to have each field in each table row with a different name (ie
> include
> > the index in it) to reference particular one using javascript.
> >
> > do I need a custom tag for this, or is one available?
> >
> > thanks very much,
> >
> > Dave
> >
> >
> >
>
>




Re: Doubt in I18N

2001-06-13 Thread Jonathan Asbell



 

  - Original Message - 
  From: 
  Greg 
  Murray 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, May 01, 2001 1:49 PM
  Subject: Re: Can not read i18n properties 
  file
  Hi all, 
  I have encountered this behavior in the past .properties files must be 
  converted to ascii using the java sdk native to ascii before the display. 
  Once converted your characters should be viewable. Also remember to set the 
  Content-Type as specified. 
     
  Jason Chaffee wrote: 
    
That would be my guess as well.  Take a look at the 
html source that is being produced and see if there is a charset header, if 
there isn't copy the source to a static file and add a charset header and 
try to load it in IE, this should give you your answer. 
-Original Message- From: 
shunhui zhu [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, May 01, 2001 11:18 AM To: [EMAIL PROTECTED] Subject: 
Re: Can not read i18n properties file 
Pau, I did a similar test for a chinese version with 
resource_zh.properties. If I change my browser 
language preferences (in IE), I do get the chinese 
version, although to display it correctly, I needed 
to select chinese encoding in IE's view menu. My 
guess is that the response header is not setting 
the "Content-language" header or the charset 
header, but I haven't looked into it. 
Shunhui --- Sean Pau 
<[EMAIL PROTECTED]> wrote: > I test 
creating resource properties file for > Japanese 
language. I use > Windows Notepad and edit 
resources_ja.properties and > save it under 
UTF-8 and > Unicode format. Struts could display 
when the file > is in UTF-8 format but 
> the text came out rubbish. When the file is in 
> Unicode format, Struts is not > reading it, instead it reads the default > resources.properties file. Both > 
UTF-8 and Unicode format resources_ja.properties > files display the Japanese > text 
OK when I drag it into IE and also WordPad. Pls > help. Thanks > > > _ 
> Do You Yahoo!? > Get your 
free @yahoo.com address at > http://mail.yahoo.com 
> 
__ 
Do You Yahoo!? Yahoo! Auctions - 
buy the things you want at great prices http://auctions.yahoo.com/


Re: help with package struts-classpath

2001-06-14 Thread Jonathan Asbell



Chuck, send me your directory structure and name of 
your server and I will tell you what your classpath should be.

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, June 14, 2001 5:03 
  AM
  Subject: Re: help with package 
  struts-classpath
  Cheers as i was about 2. 
  Hi, does anyone no why i now reciveve the following invalid package 
  declarations My Package classpath is 
  struts-bbnpa/WEB-INF/classes/org/breconbeacons/it/ActionForward.java // 
  (and the retst of the classes. struts-bbnpa the name of my webapp. 
  I have declared  package 
  org.breaconbeacons.it;    //  top of java classes. 
  Sorry 4 keeping on but all my classes now say invalid package declarations, 
  i have checked my tld's and kept away from altering the strus-config. 
  Dan Miser wrote: 
  Don't change those action types. Those are default 
classes provided in struts.jar. Open struts.jar with WinZip and you'll 
see the classes in there. They are for dynamic, run-time administration 
of your webapp and are not required at all. -- Dan Miser http://www.distribucon.com 
- Original Message - From: Chuck Amadi To: 
[EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 9:50 AM 
Subject: Re: help with package struts-classpath 
Sorry about this what happens regarding the action 
path="/admin/addFormBean" as im about to amended the 
type="org.breconbeacons.it.AddFormBeanAction. cheers chuck 
   
type="org.apache.struts.actions.AddFormBeanAction"/>
  -- The views expressed by the sender of this message don't 
  necessarily represent those of Brecon Beacons National Park Authority. 
  This message is intended for the addressee(s) only and is sent in 
  confidence; if you receive it in error, please can you let us know (at 
  [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir 
  gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc 
  Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y 
  derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych 
  yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni 
  (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.   



Re: struts and weblogic 5.1 sp9

2001-06-14 Thread Jonathan Asbell

try struts-example (with the hyphen)

- Original Message -
From: "Grant Davies" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Phil Lentz (E-mail)" <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 9:36 PM
Subject: struts and weblogic 5.1 sp9


> Hi,
>
> I've been trying to get the struts working with weblogic 5.1 sp9.  I have
> the latest version of struts (jakarta-struts-1.0-b3)  and I successfully
> deployed the struts-example.war.  (I can see it loaded and the servlets
> register correctly, I can access the jsp's inside)
>
> I can get the first page to come up by opening
>
> http://localhost:7001/strutsexample
>
> I can then click on the link
>
> "Register with the MailReader Demonstration Application"
>
> I then fill in a user name, password, 2nd password, full name, from
address
> and reply to address and then I hit save.
>
> The servlet then fails and the exception I get in the console is:
>
> Thu Jun 14 17:31:08 EDT 2001: 
> Servlet failed with Exception
> weblogic.servlet.jsp.JspException: (line 16): user is not defined as bean
> at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:673)
> at
> weblogic.servlet.jsp.JspLexer.mXML_GET_PROPERTY(JspLexer.java:2994)
> at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1707)
> at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1612)
> at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1548)
> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:888)
> at weblogic.servlet.jsp.JspParser.doit(JspParser.java:69)
> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:125)
> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:109)
> at
> weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:242)
> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:312)
> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
> at
>
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:20
> 0)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :115)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :138)
> at
>
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
> l.java:158)
> at
>
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
> va:1758)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :120)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:915)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:879)
> at
>
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
> Manager.java:269)
> at
>
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>
> Can anyone shed light on this, its driving me nuts.  I've gone through all
> the xml, dtd's, java source files and can find nothing wrong, and this is
> the example that comes with struts, completely un-touched.
>
> Cheers,
> Grant Davies
> b l u e t u b e p r o d u c t i o n s
> http://www.bluetube.com
> The new Bluetube Productions Sampler, coming August 2001
>




Re: ActionForms for read-only data??

2001-06-14 Thread Jonathan Asbell

Craig, can you explain point number one "Expose the data as JavaBeans *other
than* the form bean".  Is it that you are not using the form bean?


- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 1:19 PM
Subject: Re: ActionForms for read-only data??


>
>
> On Thu, 14 Jun 2001, hi there wrote:
>
> > Craig,
> >
> > The ActionForm class definition seems to imply that it was intended to
> > contain only editable data (i.e., the reset and validate methods).
> > Distinguishing between read and write functionality in the enterprise
> > systems I have developed was always a major advantage, both in
extensibility
> > and code maintainability, as usually each type of functionality had
> > different processing requirments.  It seems that if we mix read and
write
> > functionality into one ActionForm instance, we will have some "bulky"
> > classes to maintain.  Any comments?  Thanks.
> >
>
> There are probably multiple reasonable approaches to dealing with
> read-only data.  Let's consider some of the ways you can do this:
>
> (1) Expose the data as JavaBeans *other than* the form bean:
>
> This is quite easy, since you can do things like 
> to generate the output,  to test, and so on.
> However, you are mildly increasing the linkage between the
> model layer and the view layer -- now the developers have to
> agree on the bean name, and the properties to be used.  The
> tradeoff is that you might be able to reuse beans (such as
> value objects in an EJB based app) that already exist.
>
> (2) Copy the read-only data into the form bean:
>
> This is particularly useful in several use cases:
> - You only want to access the data nested inside the 
> - You don't want to create the extra dependency on a bean name
>   (since you can reference the form bean implicitly)
> - A particular property might be read-only in some uses of the
>   form and read-write in others (see the "username" field of the
>   RegistrationForm bean in the example application).
> However, adding new properties means going back and updating the
> form bean class every time, which can be tedious if it's not being
> automatically generated.
>
> In practice, I have used both techniques -- but in particular I find
> myself needing data outside the nested body of an , in which
> case I really need to use technique (1) anyway.
>
> Part of my internal system documentation (for the various developers) is a
> clear description of the bean names (and scopes), and the properties that
> they expose, that the page developer can count on.  This seems to deal
> with most of the manageability issues, but none of these apps have had a
> very long life yet since Struts has only been around a year :-).
>
> Craig McClanahan
>
>
> > >From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> > >Reply-To: [EMAIL PROTECTED]
> > >To: [EMAIL PROTECTED]
> > >Subject: Re: ActionForms for read-only data??
> > >Date: Mon, 11 Jun 2001 17:01:31 -0700 (PDT)
> > >
> > >
> > >
> > >On Mon, 11 Jun 2001 [EMAIL PROTECTED] wrote:
> > >
> > > > I have a Struts theory question on use of action forms versus java
beans
> > > > for read-only data.
> > > >
> > > > We have extended workflow on our website such that the same form can
> > >look a
> > > > bit different depending on where you are in the workflow.
> > > > For example, the quote request will have limit and retention fields
in
> > >the
> > > > business request section.  Once you get to quote, those fields are
> > > > read-only and there's an additional quote amount field.  When the
client
> > > > requests binder, all those fields are read-only and there is a
checkbox.
> > > > Once bound, everything is read-only.
> > > >
> > > > There is some disagreement on the team as to how to handle this
case.
> > >We
> > > > will obviously have four JSPs, one for each of these presentations.
The
> > > > question is the data mapping to beans.
> > > >
> > > > Half of the team feels that to use Struts in its purest sense, we
need
> > >to
> > > > have java beans that represent the read-only data, and action forms
to
> > > > represent the editable data.  That would mean four action forms, one
for
> > > > each JSP.
> > > >
> > > > The other half of the team wants to re-use the same action form for
all
> > > > four cases, bean:define it in the session, and use bean:write to
print
> > >out
> > > > the data if read-only.  The major advantage is simplicity - we have
one
> > > > bean that represents all of the data - there is no need to
understand
> > >what
> > > > part of the workflow we are in when translating the data from the
data
> > > > model to the presentation layer beans.  It is also easier to
understand
> > >for
> > > > an HTML programmer or developer that the same bean is used
regardless of
> > > > whether it is a bean:write or any of the html tags.
> > > >
> > > > We certainly don't want to end up in a positio

Re: Extending ActionServlet

2001-06-19 Thread Jonathan Asbell

Why dont you do what ANT does?  You can include an external reference inside
the struts-config which acts like an include.  Digester will parse
struts-config.xml which will have external references to your external xml
fragments.


- Original Message -
From: "Oleg V Alexeev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 12:48 PM
Subject: Re: Extending ActionServlet


> Hello TODD,
>
> Tuesday, June 19, 2001, 5:11:49 PM, you wrote:
>
> TH> Is there a way I can override the ActionServlet class to allow for
> TH> multiple "struts-config.xml" files to be parsed for a single
> TH> application? Our struts-config.xml file is getting rather large
> TH> and
> TH> it would be nice if we could split the struts-config.xml into
> TH> multiple .xml files and have the ActionServlet, or a descendant,
> TH> be able to parse all of the config files and store the action
> TH> mappings.
>
> You can extend ActionServelt, parse multiple
> struts-configs with Digester, store all stuff and work with it as with
> one big config. Each config must contains  tag and
> store all stuff inside of it.
> And another way - you can write you own servlet to parse configs. Use
> ActionServlet as base for your configs loader, parse and store all
> mappings by the way, similar ActionServlet.
>
> --
> Best regards,
>  Olegmailto:[EMAIL PROTECTED]
>
>




Re: Options tag - 'selected'

2001-06-20 Thread Jonathan Asbell

Martin, I have been trying to find out how to handle this for months.
Thanks

- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 12:44 AM
Subject: Re: Options tag - 'selected'


> The reason you see 'selected="selected"' is for XHTML compatibility. In
> XHTML (and XML) a value must always be specified for an attribute, so you
> can't just say 'selected'. The spec states that, in cases like this, the
> value should be the same as the attribute name. Hence
'selected="selected"',
> 'multiple="multiple"', etc.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Simon Liang" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 19, 2001 4:41 PM
> Subject: RE: Options tag - 'selected'
>
>
> > Got it, while going throught search of old mailing list emails.
> >
> >  > value="en_uk">
> >  >labelProperty="label"/>
> >   
> >
> > But look at what it produces:(instead of just 'selected', it's outputted
> > twice?)
> >
> > 
> > English
> > British English
> >   
> >
> >
> > -Original Message-
> > From: Simon Liang
> > Sent: Tuesday, June 19, 2001 4:19 PM
> > To: [EMAIL PROTECTED]
> > Subject: Options tag
> >
> >
> > Hi All:
> >
> > I don't know if i am doing something wrong or not. Either i am really
> stupid
> > or i am totally misunderstanding something here - as i have tried for
the
> > last serveral hrs getting options tag to output the 'selected' text in
> html.
> >
> > I basically followed the example(subscription.jsp) on this, but couldn't
> > figure out why it's not outputting 'selected' as the example claims is
> > working.
> >
> > 
> > <%
> >   java.util.ArrayList list = new java.util.ArrayList();
> >   list.add(new com.vns.um.struts.LabelValueBean("English", "en_us"));
> >   list.add(new com.vns.um.struts.LabelValueBean("British English",
> > "en_uk"));
> >   pageContext.setAttribute("languageTypes", list);
> > %>
> >
> > 
> > 
> >   
> >  > maxlength="10"/>
> >  > maxlength="10"/>
> >  > maxlength="10"/>
> >   
> >
> >   
> >  > match="en_uk"
> >labelProperty="label"/>
> >   
> >   
> > 
> >
> > How do i get "en_uk" selected? Thanks for any help.
> >
> > Simon
> >
> >
> >
> >
> >
>

> > This message is intended only for the use of the Addressee(s) and may
> > contain information that is PRIVILEGED and CONFIDENTIAL. If you are not
> > the intended recipient, dissemination of this communication is
prohibited.
> > If you have received this communication in error, please erase all
copies
> > of the message and its attachments and notify [EMAIL PROTECTED]
> > immediately.
> >
>

> >
> >
> >
>

> > This message is intended only for the use of the Addressee(s) and may
> > contain information that is PRIVILEGED and CONFIDENTIAL. If you are not
> > the intended recipient, dissemination of this communication is
prohibited.
> > If you have received this communication in error, please erase all
copies
> > of the message and its attachments and notify [EMAIL PROTECTED]
> > immediately.
> >
>

> >
>
>




need a clear explanation of bean.tld

2001-06-21 Thread Jonathan Asbell



Hello all.  The  tag just 
came up in a thread and I still dont know what areas the bean.tld stuff 
is specifically designed to handle as a whole.  Where is it that one 
wants to use this collection of tags' funcionality?  How should we be using 
it and how should we not be using it?
 
Jonathan


Re: [EJB] Design Patterns (was JavaReport ...)

2001-06-21 Thread Jonathan Asbell

I was on this track in another thread where I was saying...

"What if ActionForm was an inner class to a Value object.  Or, what if a
Value object had a reference to an ActionForm which when filling with
parameters we did ActionFormValue.getActionForm(), filled it, complete "does
it exist" checking and non-business object validation checking, and then do
a ActionFormValue.setActionForm(ActionForm myform) to set it back, which
would fill the ActionFormValue object with the values in the ActionForm. An
"ActionValue" could hold 1 or more ActionsForm(s) , or could take ActionForm
as a parameter, with which it would copy and "nativeize" the data in the
ActionForm.  In this case an ActionValue would hold specific fileds for the
beans it uses."

My point here,though I hope it is apparent, is that we need to send
value ojects through the system in a way in which it can complement/work
with Struts.


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 8:03 AM
Subject: Re: [EJB] Design Patterns (was JavaReport ...)


> What I'm working on now are patterns for Struts development that can be
> used with or without Enterprise Beans. As mentioned, the J2EE blueprints
> are mostly about development patterns, and Enterprise Beans are one part
> of implementating those patterns. This work is the second part of the
> Strut by Strut series ("Stepping out").
>
> I had a long discussion with a BEA Weblogic employee the other day about
> this very thing. I think we need to more strongly seperate the J2EE
> patterns from the Enterprise Bean implementation. The idea being we
> should introduce people to the pattern first (presentation beans / data
> access beans / value object beans / helper beans), and then show where
> Enterprise Beans plug into that. Or, where you would roll your own.
>
> On the Struts front, while it is often the case that the ActionForm
> beans end up looking like many of your internal beans, there are
> important differences. For example, ActionForm beans should be immutable
> except by the actor, meanwhile many of your internal beans should be
> immutable except by the model. ActionForm beans need to use Strings as
> the primary type, but your internal beans may need native types to
> commune with the business logic beans. You really only need ActionForm
> beans to get input from the actor. When sending read-only views back,
> you can use any kind of bean you want (with the bean tags), so long as
> it has a reasonable toString(). It seems wasteful at first, but in the
> big picture, it seems like treating ActionForm beans as HTTPD
> throw-aways is the only way to keep the application loosely coupled, and
> able to attach to other environments later.
>
> Of course, data transfer becomes a big issue when you have to ferry
> things from ActinForm beans to data-access beans (and then back again in
> the case of an update). What I'm looking at now is using hashmaps as a
> standard data transfer agent. If the ActionForm can return a hashmap
> that matches the data access bean you can use BeanUtil.populate() to
> make the switch. Coming back later, if the value object bean returns a
> hashmap, you can use BeanUitl.populate() to fill your ActionForm bean
> (for an update). This would mean that your ActionForm bean design
> "knows" about your value object bean design, but I think that's OK
> (though the inverse would not be OK).
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
>
> "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> >
> > To Anyone It Concerns,
> >
> > Although I'm relatively new to EJB's, I'm listed on the 1.1 TODO list
> > to add better EJB support/design patterns.  Ideas that anyone has about
> > things that they'd like Struts to do with EJB's will definately help me
> > along with this and help Struts quiet this EJB fud. I'm looking to get
> > started on this soon, and anyone who wants to is more than welcome to
> > help me out.
> >
> >  - Mike
>




Re: [EJB] Design Patterns (was JavaReport ...)

2001-06-21 Thread Jonathan Asbell

What you have here is:
1) an immutable from the web tier
2) an immutable from the enterprise tier
3) a need to update each other

Maybe they are immutable as far as standard get/set methods.
However, they can also implement an interface which uses separate secondary
fileds which start with the original values, and CAN be updated.  In this
way the 2 original models (the web tier ActionForm and the EJB model) can
have the original values untouched, and the new secondary fields will hold
and provide the updated state.


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 8:03 AM
Subject: Re: [EJB] Design Patterns (was JavaReport ...)


> What I'm working on now are patterns for Struts development that can be
> used with or without Enterprise Beans. As mentioned, the J2EE blueprints
> are mostly about development patterns, and Enterprise Beans are one part
> of implementating those patterns. This work is the second part of the
> Strut by Strut series ("Stepping out").
>
> I had a long discussion with a BEA Weblogic employee the other day about
> this very thing. I think we need to more strongly seperate the J2EE
> patterns from the Enterprise Bean implementation. The idea being we
> should introduce people to the pattern first (presentation beans / data
> access beans / value object beans / helper beans), and then show where
> Enterprise Beans plug into that. Or, where you would roll your own.
>
> On the Struts front, while it is often the case that the ActionForm
> beans end up looking like many of your internal beans, there are
> important differences. For example, ActionForm beans should be immutable
> except by the actor, meanwhile many of your internal beans should be
> immutable except by the model. ActionForm beans need to use Strings as
> the primary type, but your internal beans may need native types to
> commune with the business logic beans. You really only need ActionForm
> beans to get input from the actor. When sending read-only views back,
> you can use any kind of bean you want (with the bean tags), so long as
> it has a reasonable toString(). It seems wasteful at first, but in the
> big picture, it seems like treating ActionForm beans as HTTPD
> throw-aways is the only way to keep the application loosely coupled, and
> able to attach to other environments later.
>
> Of course, data transfer becomes a big issue when you have to ferry
> things from ActinForm beans to data-access beans (and then back again in
> the case of an update). What I'm looking at now is using hashmaps as a
> standard data transfer agent. If the ActionForm can return a hashmap
> that matches the data access bean you can use BeanUtil.populate() to
> make the switch. Coming back later, if the value object bean returns a
> hashmap, you can use BeanUitl.populate() to fill your ActionForm bean
> (for an update). This would mean that your ActionForm bean design
> "knows" about your value object bean design, but I think that's OK
> (though the inverse would not be OK).
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
>
> "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> >
> > To Anyone It Concerns,
> >
> > Although I'm relatively new to EJB's, I'm listed on the 1.1 TODO list
> > to add better EJB support/design patterns.  Ideas that anyone has about
> > things that they'd like Struts to do with EJB's will definately help me
> > along with this and help Struts quiet this EJB fud. I'm looking to get
> > started on this soon, and anyone who wants to is more than welcome to
> > help me out.
> >
> >  - Mike
>




Re: digester.addSetProperties("elemA/elemB");

2001-06-22 Thread Jonathan Asbell

Because it parsed it:

this
&<"
parsed becomes
&<"
after parsing. And the parser WILL parse it because it is an attribute. So,
if you want to end up with
&<"
use this
&amp;&lt;&quot;


- Original Message -
From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 22, 2001 6:14 AM
Subject: digester.addSetProperties("elemA/elemB");


> Hello,
>
>
> I want to use the Digester Class of STRUTS. The orignial XML-Document
> (here a snippet) is:
> 
> 
> 
>
>
> Now I call the folloging method:
> digester.addSetProperties("elemA/elemB");
>
>
> After parsing the result of the attr is:
> &<"
>
> Why? - I expect the following result:
> &<"
>
>
> Please Help!
> Hartmut
>




Implementing 2 new scopes using Struts

2001-06-25 Thread Jonathan Asbell



I will be implementing new scopes using Struts for 
our unique needs, and they need to be application server 
independent.  
 
One scope will work 
across (between) web-applications:  Ex. user logs on, and an object 
representing the users values and state is placed into a scope where ALL WEB 
APPLICATIONS can see it.
 
Another scope is restricted 
to specified directories inside of an application:  Ex. data saved 
would only be visible when inside a specific sub-directory.
 
I am currently examining 
the 2.3 servlet spec.  Does anyone have any advice as to what to watch out 
for in implementing this considering I want to be able to be compatible 
with servlet containers in general and leverage container management and web.xml 
configuration.  Could anyone refer me to some specific sections in the 
servlet spec that you feel I should pay specific attention to while I am doing 
this. 
 
Thank you
Jonathan


Re: Implementing 2 new scopes using Struts

2001-06-25 Thread Jonathan Asbell



JNDI is expensive.  Then second one is a 
restriction of data storage visibility to a sub-directory of a Web app.  
Ex. I have a web app called myWebApp, which has its own WEB-INF directory 
with a web.xml inside. Below myWebApp I hav 3 directories called Jon, 
Nanduri, and Ted.  I want to store things that pertain to the Jon branch 
which neither the Ted branch nor the Nanduri branch can see.

  - Original Message - 
  From: 
  Nanduri, Amarnath 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, June 25, 2001 8:21 AM
  Subject: RE: Implementing 2 new scopes 
  using Struts
  
  Jonathan,
   
  >One scope will work 
  across (between) web-applications:  Ex. user logs on, and an object 
  representing the users values and 
  state is
   >placed into a scope 
  where ALL WEB APPLICATIONS can see it.
   
     Use JNDI and throw the user info up the jndi 
  tree
   
  I 
  didn't understand your second scope. Can you elaborate. 
  Thanks.
   
  cheers,
  Amar..
   
    
  
-Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Monday, June 25, 2001 8:24 
AMTo: [EMAIL PROTECTED]Subject: 
Implementing 2 new scopes using Struts
I will be implementing new scopes using Struts 
for our unique needs, and they need to be application server independent.  

 
One scope will 
work across (between) web-applications:  Ex. user logs on, and an 
object representing the users values and state is placed into a scope where 
ALL WEB APPLICATIONS can see it.
 
Another scope is 
restricted to specified directories inside of an application:  Ex. 
data saved would only be visible when inside a specific 
sub-directory.
 
I am currently 
examining the 2.3 servlet spec.  Does anyone have any advice as to what 
to watch out for in implementing this considering I want to be able to 
be compatible with servlet containers in general and leverage container 
management and web.xml configuration.  Could anyone refer me to 
some specific sections in the servlet spec that you feel I should pay 
specific attention to while I am doing this. 
 
Thank you
Jonathan


Re: Submitting unicode characters from form fields

2001-06-26 Thread Jonathan Asbell

You must configure your web application to DECODE the utf8 encoded stuff.
In weblogic I make this entry in the web.xml file:



weblogic.httpd.inputCharset./*
UTF-8



I'm not sure what you need for tomcat configuration

QUOTING AN E-MAIL FROM HANS BERGSTEN

8859-1 is [currently] the default
encoding of HTTP. When a browser sends a parameter in some encoding, such
as UTF-8, it encodes each character byte value as a hexadecimal string using
the encoding for the page (e.g. UTF-8). At the server, however, the part of
the container that interprets these character values always assumes they
are 8859-1 byte values. So it created a Unicode string based on the byte
values interpreted as 8859-1. In the Servlet 2.3 spec it will be possible to
tell the container to use
another encoding that 8859-1 to interpret the parameter value bytes, but
for now we're stuck with this "hack".



- Original Message -
From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 10:00 AM
Subject: Submitting unicode characters from form fields


> Guten Tag,
>
> my problem is:
> How can unicode be submitted from form fields in an adequate way to the
> server?
>
> I'm using the struts framework and trying to submit some unicode text in
> a HTML form to the server. My Target is, to use that unicode characters
> on the server (as parameter for a RPC to a lecacy application).
>
> It is not a problem for me to display that unicode characters in the
> browser by declaring:
>
><%@ page language="java" contentType="text/html;charset=UTF-8" %>
>
>and in the head:
>
>
>
> But it is a problem to go the way in the other direction:
>
> 1. The IE5.5 (much better: Netscape 6) does not display the unicode
> characters in the form field correctly (i. e. he shows something like
> |||). BTW: I cut & paste the Unicode from the browser from a page
> that displays unicode characters (s.a.).
>
> 2. When I submit the form, then I ask in the Action-Class for
> request.getCharacterEncoding(), but the resulting String is null, even
> though I specified in my JSP something like:
>  enctype="text/plain;charset=UTF-8">. Why is getCharacterEncoding() ==
> null??
>
> 3. When I read the form-field with the unicode data, I get:
> Ë?ãúã?ã?ã¦ã©ã©. I think, this is UTF-8, isn't it (I'm not sure)?
>
> 4. When I take exactly that string and display it again with a JSP-Page,
> I get somthing other (ӁƣÆ?Æ?ƱƸƸ) than the original, from where I
> cutted & pasted the characters (s. a.). Why?
>
> Question: Must I convert the POSTed data before processing with it? Must
> I implement some mechanism for converting UTF-8[??] to Unicode?
>
> I greatly appreciate your help!
>
> Chiao
> Hartmut
>




Re: concatenating resources files - in which class?

2001-06-28 Thread Jonathan Asbell

I think I will do the following:
1) Identify which Locals I am supporting and declare them within web.xml
fr_FR.properties
es_ES.properties
es_EN.properties
en_EN.properties

2) On loading the servlet, for each Local I will search for ".properties"
files and create a FileInputStream for each

3) I will create a target file called "Resources_xx_xx.properties" and read
each file in to it, repeating this for each Local until I have one master
properties file for each local
Resources_fr_FR.properties
Resources_es_ES.properties
Resources_es_EN.properties
Resources_en_EN.properties

Thats it!


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 7:26 AM
Subject: Re: concatenating resources files - in which class?


> The safest thing is to have them under WEB-INF/classes, which is already
> on the classpath.
>
> I agree that keeping like resources together is good idea, but are they
> only used by the templates? Do not the Action classes also use these for
> messages.
>
> The JSP's under /WEB-INF/pages are really source code files, and if you
> precompiled them that folder might be omitted. So personally I would
> suggest not putting runtime resources in that branch, unless the
> multiple resources files are moved to another location as part of the
> concaternation process. (Are you doing this with Ant?)
>
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
> > Jonathan wrote:
> >
> > Anyone have any suggestions as to where in the code I should
> > concatenate my multiple resource files?  I actually would like the
> > resource files to be in the same directory as the templates to which
> > they pertain (ie in with the jsp files).  Assuming I put my jsp's in
> > WEB-INF/pages, I guess I would have to put the WEB-INF in the
> > classpath as well so that the properties files are visible to the
> > ActionServlet.
>




attributes in the Bean & Logic tags - Help

2001-06-29 Thread Jonathan Asbell



I have been looking at the documentation and I am 
still not comfortable with understanding what certain attributes represent in 
the Bean & Logic tags. I am particularly confused 
with nested tags and  these attributes:
 
id=
name=
property=
 
Could one of you kind gentlemen help with a concise 
yet on the money explanation.
I am understanding that the value placed in 
"property" will translate to a getProperty, but I am not sure which bean it 
pertains to?


If no ActionForm associated with Action....ActionForm is null???

2001-07-05 Thread Jonathan Asbell



Hello.  In places where there are no forms and 
thus did not configure an ActionForm for a particular Action, does the 
ActionForm object which is passed to the perform method have a "null" 
vlaue?


processPath() method returning the wrong path

2001-07-05 Thread Jonathan Asbell






Hello all.  I was reading about the 
struts problem with i-Planet and wondering if I have the same problem.  We 
are using i-Planet as a web server along with weblogic 5.1 as an app 
server.  I am not sure which i-Planet version we have but I will find out 
tomorrow.  My problem is below..
 
 
I am submitting to an Action which FORWARDS 
to a second Action, which REDIRECTS to a third Action which 
FORWARDS to a jsp
 
Action1-(Fwd)>Action2-(Redr)>Action3-(Fwd)>jsp
 
Action 3 never gets triggered because the mapping somehow does not 
match.  When I look to see the mapping the ActionServlet generates at 
that point, it appears that it has calculated the path incorrectly.  I end up at the following URI with the following 
message:

http://localhost:7001/successmtgs/postsecure_jump.do 
Invalid path /successmtgs/postsecure_jump was 
requested
 
The final action should be triggered by path="/postsecure_jump".  The path that is being 
looked up for the mapping is "/successmtgs/postsecure_jump".  
I shouldnt be getting this value because the 
ActionServlet's processPath() method is supposed to
find the last occurence of a "/" [int slash = 
path.lastIndexOf("/");]
So my path to match becomes - /successmtgs/postsecure_jump
instead of - 
/postsecure_jump
Now the mapping is wrong and I wont be able to 
forward
 
 
 
 
HERE ARE MY STEPS
=
step 1 - I am on localhost
http://localhost:7001/successmtgs/index.jsp
I jump to another server via a link
 
step 2 - I am on another server
http://anotherhost:8007/successmtgs/signin.jsp
I submit a form to /process_logon.do
 
step 3 - the servlet is triggered and runs an 
action
path="/process_logon"
this action FORWARDS 
to another action path="/presecure_jump.do"
 
step 4 - this second action is run
path="/presecure_jump"
this action REDIRECTS to another 
action path="/postsecure_jump.do"
 
(dies here..)
 
step 5 - ACTION NEVER GETS RUN BECAUSE "No mapping available for path 
"/successmtgs/postsecure_jump"
path="/postsecure_jump"
FORWARD to 
path="/successmtgs/index.jsp"
=
 
 
 


iPlanet- I'm having the same problem....

2001-07-06 Thread Jonathan Asbell



Did you see my post last night?  Supposedly 
iPlanet implemented a piece of the servlet spec incorrectly and you need to 
upgrade it with a service pack for the ActionServlets processPath() method to 
get the correct value for request.getServletPath().  Mikkel, send me your 
number and e-mail me at work so we can help each other work this out.  



revised struts visual

2001-07-08 Thread Jonathan Asbell



 
 struts_function.gif


Re: Still struggling with my Iplanet 4.1

2001-07-09 Thread Jonathan Asbell

make sure struts.jar is in your classpath in kregedit.
 Also, if you have any ActionClass or FormClasses that
you're calling from action, you'll need to make sure
the full path to
\iPlanet\ias6\...\APPS\...\WEB-INF\classes is in your
classpath.  It's a bug in iPlanet, but this workaround
works like a charm.  Let me know if you have any other
iPlanet issues, as I have spent a fair amount of time
getting struts to work on iPlanet.

If a JSP
defines a prefix with the same name as a literal
HTML-tag like html, body, head, etc.,you'll run
into this problem.

E.G:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

...

Since the code in the JSP is case sensitive, changing
the case of the literal HTML-tags (or the prefixes)
already solves the problem:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

...



I figured out the problem.  For the interest of the mail archives, the
solution is to use regular expressions in obj.conf.  "*.do" is not enough
for iPlanet (struts documentation should be ammended for this).  I found I
needed to use "*.do;jsessionid*" in addition to "*.do".  This fixed the
problem.  Note: rules.properties didn't seem to work either since the
servlet is running from tomcat, not iPlanet.


- Original Message -
From: "Mikkel Bruun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 6:38 AM
Subject: SV: Still struggling with my Iplanet 4.1


> thanks for your input...
>
> Im currently loading all the dtd's frm localhost...
>
> I havent checked whetether or not IWS comes with an xml parser, but
> currently i have added jaxp.jar and parser.jar from the tomcat
installation
> to my classpath...
>
> i thought that i had the taglibs running, but it seems like ive stumbled
> upon another problem...
> I get the following exception:
> -
> org.apache.jasper.JasperException: Unable to open taglibrary
> /jbpb/taglibs/html-
> tags.jar : com.sun.xml.tree.TextNode
> 
>
> reading the docs for iplanet the exception should arise when a .tld doesnt
> contain a dco type tag...however, my tld already does that!
>
> Here a snippet from the tag tld
> 
> 
>  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
> "http://localhost:81/jbpb/dtds/web-jsptaglib_1_1.dtd";>
>
> 
> 
> the url is browsable
>
>
> Heres a snippet of the .jsp Im trying to run
> ---
> <%@page language="java" %>
> <%@ taglib uri="/jbpb/taglibs/html-tags.jar" prefix="html" %>
> 
> still here!
> --
> the taglib uri, is a *real* url as jbpb is actually a link to
> /home/users/jbpb/webroot
>
> -
>
> Mikkel
>
>
>
>
>
>
>
> -Oprindelig meddelelse-
> Fra: Hellmann, Martin (Paragon IT)
> [mailto:[EMAIL PROTECTED]]
> Sendt: 09 July 2001 12:27
> Til: '[EMAIL PROTECTED]'
> Emne: RE: Still struggling with my Iplanet 4.1
>
>
> Although I am quite new to struts, I'd like to participate in this IPlanet
> discussion because
> we are probably going to deploy our app to the same AS.
> But actially we haven't tested anything yet under that environment, so all
> comments are warmly welcome.
>
> Concerning your xml problems:
> To my experience xml parsing problems arise usually for 2 reasons:
> - You're working behind a firewall and the parser isn't able to load the
DTD
> via internet,
>   deleting the doctype -DTD definition of your xml-file or changing it to
a
> local path often solves this prob.
>
> - Or, it could be as well that IPlanet comes with its own xml jars. If so,
> you have to ensure that strut's
>   conform xalan.jar, xerces.jar in version 1.2 are found in the
application
> servers classpath before any other
>   xml parsers.
>
> Best regards
> Martin
>
>
>
> -Original Message-
> From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
> Sent: Montag, 9. Juli 2001 09:13
> To: '[EMAIL PROTECTED]'
> Subject: Still struggling with my Iplanet 4.1
>
>
> Hi guys,
>
> there hasnt been much response to my Iplanet mails, but here goes another
> one...
>
> I have finallt succeded in deploying the taglibs, getting IWS to recoqnize
> the strust.dtd and the action servlet is ALMOST running
> However i get a SaxException when it tries to parse the config.xml from
the
> example application
>
> Any suggestions???
> --
>
> org.xml.sax.SAXParseException: Attribute "forward" is not declared for
> element "action".
> at com.sun.xml.parser.Parser.error(Parser.java:2795)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1357)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
> at com.sun.xml.parser.Parser.parse(Parser.java:284)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
> at j

Re: Still struggling with my Iplanet 4.1

2001-07-09 Thread Jonathan Asbell

This is a common problem when configuring struts on weblogic. Reason is that
the parser could not fetch the
file(http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd) from the
web.
The easiest way is to alter the request to your local file.
For example:
FROM:
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd>

TO:


-Zhao



- Original Message -
From: "Mikkel Bruun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 6:38 AM
Subject: SV: Still struggling with my Iplanet 4.1


> thanks for your input...
>
> Im currently loading all the dtd's frm localhost...
>
> I havent checked whetether or not IWS comes with an xml parser, but
> currently i have added jaxp.jar and parser.jar from the tomcat
installation
> to my classpath...
>
> i thought that i had the taglibs running, but it seems like ive stumbled
> upon another problem...
> I get the following exception:
> -
> org.apache.jasper.JasperException: Unable to open taglibrary
> /jbpb/taglibs/html-
> tags.jar : com.sun.xml.tree.TextNode
> 
>
> reading the docs for iplanet the exception should arise when a .tld doesnt
> contain a dco type tag...however, my tld already does that!
>
> Here a snippet from the tag tld
> 
> 
>  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
> "http://localhost:81/jbpb/dtds/web-jsptaglib_1_1.dtd";>
>
> 
> 
> the url is browsable
>
>
> Heres a snippet of the .jsp Im trying to run
> ---
> <%@page language="java" %>
> <%@ taglib uri="/jbpb/taglibs/html-tags.jar" prefix="html" %>
> 
> still here!
> --
> the taglib uri, is a *real* url as jbpb is actually a link to
> /home/users/jbpb/webroot
>
> -
>
> Mikkel
>
>
>
>
>
>
>
> -Oprindelig meddelelse-
> Fra: Hellmann, Martin (Paragon IT)
> [mailto:[EMAIL PROTECTED]]
> Sendt: 09 July 2001 12:27
> Til: '[EMAIL PROTECTED]'
> Emne: RE: Still struggling with my Iplanet 4.1
>
>
> Although I am quite new to struts, I'd like to participate in this IPlanet
> discussion because
> we are probably going to deploy our app to the same AS.
> But actially we haven't tested anything yet under that environment, so all
> comments are warmly welcome.
>
> Concerning your xml problems:
> To my experience xml parsing problems arise usually for 2 reasons:
> - You're working behind a firewall and the parser isn't able to load the
DTD
> via internet,
>   deleting the doctype -DTD definition of your xml-file or changing it to
a
> local path often solves this prob.
>
> - Or, it could be as well that IPlanet comes with its own xml jars. If so,
> you have to ensure that strut's
>   conform xalan.jar, xerces.jar in version 1.2 are found in the
application
> servers classpath before any other
>   xml parsers.
>
> Best regards
> Martin
>
>
>
> -Original Message-
> From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
> Sent: Montag, 9. Juli 2001 09:13
> To: '[EMAIL PROTECTED]'
> Subject: Still struggling with my Iplanet 4.1
>
>
> Hi guys,
>
> there hasnt been much response to my Iplanet mails, but here goes another
> one...
>
> I have finallt succeded in deploying the taglibs, getting IWS to recoqnize
> the strust.dtd and the action servlet is ALMOST running
> However i get a SaxException when it tries to parse the config.xml from
the
> example application
>
> Any suggestions???
> --
>
> org.xml.sax.SAXParseException: Attribute "forward" is not declared for
> element "action".
> at com.sun.xml.parser.Parser.error(Parser.java:2795)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1357)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
> at com.sun.xml.parser.Parser.parse(Parser.java:284)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
> at org.apache.struts.digester.Digester.parse(Digester.java:725)
> at
>
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1302)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
> at javax.servlet.GenericServlet.init(GenericServlet.java:219)
> at
>
com.netscape.server.http.servlet.NSServletEntity.load(NSServletEntity.java:3
> 77)
> at
>
com.netscape.server.http.servlet.NSServletEntity.update(NSServletEntity.java
> :149)
> at
>
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
> a:461)
> Parse Error at line 127 column -1: Attribute value for "type" is
#REQUIRED.
> org.xml.sax.SAXParseException: Attribute value for "type" is #REQUIRED.
> at com.sun.xml.parser.Parser.error(Parser.java:

Struts Documentation (*Ted & Craig*)

2001-07-09 Thread Jonathan Asbell



I wanted to know what you finally decided on 
regarding my recent documentation submission.  Also, I wanted to know if 
you saw the pictorals and thought they were accurate.
    On a side note, I have been 
struggling with a struts component that seems simple, yet I am stuck and cant 
understand it.  My impasse is in the path matching behavior of the 
servlet.  Has anyone implemented the matching on a path regardless of 
depth.  Like in the digester, where you can match on any "a" tag by using 
"*/a".  I am finding that Struts is forcing me to specify full paths to my 
actions, and that there is no way to get the text matching behavior of the 
Digester or xsl.  Is this the case?
 
Jonathan


Re: Struts Documentation (*Ted & Craig*)

2001-07-10 Thread Jonathan Asbell

Kind of.  Below are two messages I sent in which the issue is more explicit:
===
  Can someone tell me if there is a way to configure an action to match
a path regardless of how deep it is in a directory?  That is, I want
"/display.do" to be triggered in each case below:

  "/charts/display.do"
  "/news/display.do
  "/events/outdoors/display.do"

  How can I accomplish this?

===
A potential implementation clarification/development consideration.
If I submit a form action="/login.do", the Action triggered must exactly
match "/login.do" and not partial match.That is, action="/signup/login.do"
will not match.  Now this may or may not be the desired behavior.  You may
in fact want any url that ends in "/login.do" to trigger the specific
Action, or you may not.  It seems that Struts is handling the exact match
case correctly, so it is not a bug.  However, it was not clear to me that
the Action needed an exact match of the full path.  In fact, our
ActionServlet is triggered on ANY url that ends in ".do". and configurable
to be triggered on a more specific path.

===


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 6:04 AM
Subject: Re: Struts Documentation (*Ted & Craig*)


> > Jonathan Asbell wrote:
> > I wanted to know what you finally decided on regarding my recent
> > documentation submission.  Also, I wanted to know if you saw the
> > pictorals and thought they were accurate.
>
> We should probably continue this on the DEV list so the threads don't
> get tangled ;-)
>
> > On a side note, I have been struggling with a struts component
> > that seems simple, yet I am stuck and cant understand it.  My impasse
> > is in the path matching behavior of the servlet.  Has
> > anyone implemented the matching on a path regardless of depth.  Like
> > in the digester, where you can match on any "a" tag by using "*/a".  I
> > am finding that Struts is forcing me to specify full paths to my
> > actions, and that there is no way to get the text matching behavior of
> > the Digester or xsl.  Is this the case?
>
> I've never tried that myself.
>
> In general, Struts encourages developers to be explicit regarding
> entry points to their applications.
>
> What are the design benefits of having the application walk up the tree
> looking for an action to match?
>
> Is it you want the option to override calling /login.do by simply
> defining /account/login.do later?
>
> Something similar could be done with a local forward, where each
> mapping forwards to "login" but could have different paths specified.
>
> (Though, I have the feeling that the problem is that you don't want to
> specify the paths ;-).
>
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>




Re: requirements for path triggering actions

2001-07-23 Thread Jonathan Asbell

I think you may have misunderstood the problem.  ".do" IS triggered, but the
Struts mapping object registered under the "path" may not be found.  In
other words consider:

"/charts/display.do"
"/news/display.do
"/events/outdoors/display.do"

I want ANY occurence of  "display.do" in the path to trigger a particular
mapping



- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Jonathan" <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 1:29 AM
Subject: Re: requirements for path triggering actions


>
>
> On Mon, 9 Jul 2001, Jonathan wrote:
>
> > Can someone tell me if there is a way to configure an action to match
> > a path regardless of how deep it is in a directory?  That is, I want
> > "/display.do" to be triggered in each case below:
> >
> > "/charts/display.do"
> > "/news/display.do
> > "/events/outdoors/display.do"
> >
> > How can I accomplish this?
> >
>
> The Servlet 2.2 (or 2.3) spec defines all the legal forms of
>  patterns, and can be downloaded at:
>
>   http://java.sun.com/products/servlet/download.html
>
> For your purposes, you will find that the "*.do" pattern does indeed match
> all of the above.  The corresponding action paths should be
> "/charts/display", "/news/display", and "/events/outdoors/display".
>
> Craig McClanahan
>
>
>




Workflow impasse? New ideas.

2001-07-23 Thread Jonathan Asbell



Hello all.  I just got back and was reading 
the e-mails about workflows.  By the tone and lack of dialog I think that 
we are not sure how we really want to design workflows still.  So lets 
have more discussion on the subject.  When its clearer we will better know 
what we want to do.
 
Here are some ideas I thought could break down 
the problem a little more.  I was thinking that a workflow can be described 
in the following ways:
 
1) It has a specific order
2) It DOES'NT having a specific order
3) It has a combination of tasks, some of which 
need to be executed in order, and others that do not
4) All of its tasks must be finished at the 
end
5) It May be made up of other 
worklflows
 
Therefore, you would get a workflow with the 
characteristics you want.  At the end you would make sure all tasks have 
been done in order it to be considered a completed workflow.  For items 
that need order we can use the struts config file to put an entry in for 


 
  
  
  
 

 
anyone want to add


referring to the DTDs

2001-07-25 Thread Jonathan Asbell



I was wondering if there is a way for an xml doc to 
look for a dtd in 2 or 3 places.  Can you do this:
 

            "file:///c:/bea/wlserver6.0/config/Wcom/applications/mydomain/WEB-INF/struts-config_1_0.dtd
    "file:///c:/dtds/struts-config_1_0.dtd
        "struts-config_1_0.dtd>
The reason is that I want to refer to the dtd using a 
RELATIVE path on both UNIX and 
NT


Feature enhancement - triggering an Action

2001-07-25 Thread Jonathan Asbell



This thread appeared on the list earlier this 
week.
 
QUESTION - JonathanCan someone tell me if there 
is a way to configure an action to match a pathregardless of how deep it is 
in a directory?ANSWER - TedNo. There is not a way to do this, 
without changing the way Struts isprogrammed to behave. You could request a 
feature change in Bugzilla, andbring it up on the DEV list for 
discussion.==As 
I was experimenting with our struts app I ran into the situation where 
Iwanted a generic "path-indifferent" name to trigger an action.  
Forinstance, in the following three 
cases:"/charts/display.do""/news/display.do"/events/outdoors/display.do"I 
didnt care about anything except the existence of  "display.do" 
ANYWHEREat the end of ANY path.  In fact, isnt this exactly how the 
servlet istriggered with ".do"  This is what I expected, and the 
current Struts designwont let me do this.  Do you all think this is an 
important feature?  Ireally would like it as it can give a sense that 
the behaviour is common,and saves me time in thinking about how to properly 
trigger that particularaction I was wanting.


Class loading......2 times using 2 class loaders

2001-07-27 Thread Jonathan Asbell

You wrote
==
> To run multiple Struts-based apps in the same servlet container, you must
> copy the struts.jar file into the /WEB-INF/lib directory of each
> individual web app (along with copying the TLD files).
>
> Having struts.jar outside of the web apps (i.e. on some shared classpath
> somewhere) is guaranteed not to work.  The most common symptom is
> ClassNotFoundException when parsing, but that's only one of many things
> that will go wrong.  It is *much* more complex than just finding the DTD
> -- it has to do with the fact that shared classes cannot see classes
> loaded by the webapp class loader.
==

We are using weblogic 5.1 and are constantly having issues to resolve with
class loading.  We are NOT placing our /classes and /lib etc inside of the
WEB-INF directory for reasons of simpifying migration from NT to UNIX.
Instead we have the entire application outside of the weblogic directory
starting at the root (C: for NT, and /whatever for UNIX).  Our scripts point
to the correct places so weblogic and the java classloader can find them to
load.  We only have one web application now, however, and will for the
forseeable future.  I bring all this up because we load some classes in
separate class loaders, and other classes are loaded by both!  We need to do
this because of this setup.  I dont know what all the consequences of this
are, but I just read an article about classloading where it suggests using
".ear" files to remedy this classloading issue.  Could you please comment.
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html






Re: Are form tags tied to beans?!!!

2001-07-31 Thread Jonathan Asbell

I know.  This is what I had and didnt like.  So we are saying that we need
to re-design the html form tags to handle this in an elegant way, right?


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 7:12 AM
Subject: Re: Are form tags tied to beans?!!!


> If you want the value of a control to be dynamic and determined from an
> object other than an ActionForm, then use bean:write
>
> 
>
>
> Jonathan Asbell wrote:
> >
> > Yes I know, but I want some of the attributes to be dynamic
> >
> > - Original Message -
> > From: "Ted Husted" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Monday, July 30, 2001 8:56 PM
> > Subject: Re: Are form tags tied to beans?!!!
> >
> > > You can mix and match the html:form tags with the standard HTML form
> > > tags. So, just code  > >
> > > The html:form tags are a handy way to prepopulate the HTML form
elements
> > > from a bean. But they are only a means to an end. If you don't need to
> > > prepopulate the field, then you don't need to use a html:form tag.
> > >
> > > If for any reason you wanted to pass a "flag" bean to your form, to
set
> > > that dynamically, you could also pass a second form ActionForm bean.
The
> > > default is to use the bean tied to the Action path, but you can also
> > > overide that on a tag by tag basis.
> > >
> > > > Jonathan wrote:
> > > >
> > > > I need to dynamically fill a form with values.  The problem is that
> > > >  and other form tags REQUIRE the attribute "property".
> > > > However, there may be fields that I submit that I DONT want to be
> > > > values in the bean.  For example, I may want to add a hidden field
> > > > that is NOT a value in the bean, but merely a "flag" in the request.
> > > > How is this done in a clean way, considering that the form tags all
> > > > require "property" as an attribute, and that value must be a member
> > > > value in a bean?
> > >
>




how do I get error messages?

2001-04-22 Thread Jonathan Asbell



I have the below form.  In the ActionForm 
class for this form I am testing for a valid username.  The code is like 
so: errors.add("username", new 
ActionError("error.username.required"));  In my mappings I have the 
response going back to this same page if anything is not valid.  But how do 
I get access the messages in the ActionErrors object using a tag,  I have 
tried  on the same page with no results.
 
    
USER 
ID:    
   PASSWORD:*
    
  


Can someone explain the "path" attribute in action-mappings

2001-04-22 Thread Jonathan Asbell



How exactly do I implement it?  The doc say 
"The application context-relative path to the action", but this is not clear to 
me.  I am having the same trouble implementing the "input" attribute.  
Can anyone make this clear for me:  What should the value 
be?


Re: Required vs. optional "name" attribute

2001-04-23 Thread Jonathan Asbell

Incidentally, can antone tell me the difference between id, name, and
property?  (org.apache.struts.taglib.bean)


- Original Message -
From: "James Howe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 12:01 PM
Subject: Re: Required vs. optional "name" attribute


> At 10:00 PM 4/22/2001 -0700, you wrote:
>
>
> >On Wed, 18 Apr 2001, James Howe wrote:
> >
> > > I apologize in advance if this topic has come up before, but ...
> > >
> > > I'm building a Struts JSP page containing a form.  I've noticed that
the
> > > HTML tags typically do not require the specification of a "name"
attribute
> > > in order to retrieve property values from a bean.  If the name isn't
> > > specified, the property value is retrieved from the bean associated
with
> > > the form.  However, logic tags require the use of the name attribute
in
> > > order to retrieve a property.  [...]
> >
> >The HTML-oriented tags that allow you to default the "name" attribute can
> >*only* be used within an  tag -- they are not useful in any
> >other context.
> >
> >The logic tags (and the bean tags as well) are general purpose tools,
> >useful either inside or outside a form.  It would be technically feasible
> >to do what you suggest, but IMHO it would be very confusing to have the
> >same tag do two different things depending on whether you nested it or
> >not.
> >
> >Craig
>
>
> I understand your point.  How about if there were a new tag in Struts
> called "defaultName" (or something similar).  In the defaultName tag, you
> could identify a bean which automatically be referred to by all other tags
> unless a different bean name attribute were specified on a tag.  This
would
> let you include common code and the common code wouldn't have to know the
> name of the bean from which it got its value unless it wanted to.
>
>
> James W. Howe   mailto:[EMAIL PROTECTED]
> Allen Creek Software, Inc.  pgpkey:
http://ic.net/~jwh/pgpkey.html
> Ann Arbor, MI 48103
>




Re: HTML special characters

2001-04-23 Thread Jonathan Asbell

Doesnt this issue depend on the character encoding?  That is, high ascii
values (128-255) are control characters in some encodings, which I assume
you want to get rid of.  Than, there is the 0-31 characters in ascii which
are control characters of which you want to get rid of all except tabs,
spaces, carriage returns, and line feeds.  Than there are characters
reserved for private use in other ranges.  FYI Macintosh has a 0x0 character
which breaks alot of apps, and netscape for mac versions 4.x  have a bug
which introduces control characters on html form submissions.


- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "struts-user" <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 9:48 PM
Subject: Re: HTML special characters


>
>
> On Fri, 20 Apr 2001, Peter Alfors wrote:
>
> > Hello all,
> >
> > Is there any plan to update the ResponseUtil.filter() method to
> > handle more (or all) of the HTML special characters?
> > It looks like right now only 4 are being handled.
> >
> > Thanks,
> > Pete
> >
>
> What other characters are you concerned about?  The purpose of filtering
> was to avoid problems where user data had HTML markup in it, but it wasn't
> designed to be a general purpose encoding mechanism.
>
> Craig
>
>




*** implementing consecutive form validation? ***

2001-04-23 Thread Jonathan Asbell



If a form is made up of three consecutive pages and 
I want to validate page by page, how should I go about doing this?  Do I 
use three ActionForms and one Action?  Do I use the validation the 
ActionForm offers for basic validation?  Do I fill one ActionForm's 
validation method with "if/then" statements to test if I am on the first, 
second, or third page of the form and then use the Action's validate method at 
the end?
I was interested in what you all were 
implementing.
Cheers 
 
Jonathan


why does struts use forward instead of redirect

2001-04-24 Thread Jonathan Asbell



Anyone know why struts uses forward instead of 
redirect?


Displaying dynamic content - html from xslt

2001-04-25 Thread Jonathan Asbell



Our system submits a request to a jsp page 
which contains jsp tags.  When the request hits the jsp page the tag 
macros communicate with EJB's which call xml from the database, 
run the xml against stylesheets, and slap the output in the places where 
tags were in the jsp page (ie. simply using jsp tags with xml and 
styleshets).  I am interested in using struts to accomplish this for me, 
but I am not sure how to implement this architecture with struts.  Do I 
have an Action object do the call, put the html output I retrieved from the xslt 
transformation into a bean, and then call a getContent() method of the bean to 
place the dynamic content a specific aea on the jsp page?  Do I 
still use custom tags, but within the struts tags?


Can someone explain in more detail the "path" & "input" attribute values of Action

2001-04-25 Thread Jonathan Asbell



It is not clear to me exactly whatthese values 
could or should be.  I understand that the ".do" is stripped of the 
request, so does that mean I only have to match everything up to the ".do" 
?  Why is a "/" used?  To me this means "root", and in fact in the 
Login example the path changes from "/mysite/logon/logon.jsp" to 
"/mysite/login".  I am aware of the side effects of forwarding on the url, 
but I am confused as to how to employ the "input" and "path" 
values.


Possiblility Answer to: html form widgets not appearing

2001-04-28 Thread Jonathan Asbell

It sounds like you have a "classpath problem".  I bet you either have a
system classpath (ie a classpath set in your
settings/controlpanel/system/advanced/environmentvariables assuming it
is a pc) which conflicts with the classpath you start up when you run your
server.  Either way it seems that it cant find your file in the classpath to
load.  Try to loop through and print to the console all of your system
variables at the point after you start up your server. (cut and paste class
below)
What you are looking for is the following system properties:
"java.class.path"
"user.dir"
Put your properties in the directory that indicates your "user.dir".  If it
works than your problem is your classpath.

import java.util.*;
public class DisplayEnvironment{
 public static void main(String[] args){
  new DisplayEnvironment();
 }
 public DisplayEnvironment(){
  System.out.println("");
  displaySystemProperties();
  System.out.println("");
  displayWeblogicProperties();
  System.out.println("");
 }
 private void displaySystemProperties(){
  Properties p = System.getProperties();
Set set = p.keySet();
Object[] o = set.toArray();
List l = Arrays.asList(o);
Collections.sort(l);
Iterator i = l.iterator();
  while(i.hasNext()){
   String s = (String)i.next();
   System.out.println(s + " " + p.getProperty(s));
   System.out.println("");
  }//while
 }//method
 private void displayWeblogicProperties(){
 }
}








- Original Message -
From: "Jason Chaffee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 28, 2001 1:30 AM
Subject: Re: html form widgets not appearing


> The app server is the container for the servlet, so all of servlet code is
being
> done by the app server, therefore if something is implemented wrong like
> getServletContext() or something, than you will have a problem.  Weblogic
has
> all kinds of bugs like this.
>
> "G.L. Grobe" wrote:
>
> > Are you sure it's up to the app server to pass the found resources to
> > struts. I thought I passed over some code where struts did the reading
of
> > params from web.xml? Therefore making it a struts problem.
> >
> > - Original Message -
> > From: "Jason Chaffee" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, April 27, 2001 11:59 PM
> > Subject: Re: html form widgets not appearing
> >
> > > If you have everything set correctly as you say, there might be a bug
with
> > you app
> > > server and its ability to find resources.
> > >
> > > "G.L. Grobe" wrote:
> > >
> > > > Ok, I just grabbed the struts nightly source from 4-27 and built it
and
> > > > sprinkled loadLocale() with println()'s. I got the same errors. Very
> > true
> > > > that if loadLocale does not find the file, it will not trap the
error.
> > > >
> > > > ---My jsp page printed this --
> > > > 500 Internal Server Error
> > > > javax.servlet.jsp.JspException: Cannot find message resources under
key
> > > > org.apache.struts.action.MESSAGEat
> > > > org.apache.struts.util.RequestUtils.message(RequestUtils.java:292)
> > at
> > > >
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
> > at
> > > > /index.jsp._jspService(/index.jsp.java:148) (JSP page line 129) at
> > > > com.orionserver[Orion/1.4.8 (build
> > > > 10374)].http.OrionHttpJspPage.service(Unknown Source)   at
> > > > com.evermind[Orion/1.4.8 (build 10374)]._aj._nxd(Unknown Source)
> > at
> > > > com.evermind[Orion/1.4.8 (build
> > > > 10374)].server.http.JSPServlet.service(Unknown Source)  at
> > > > com.evermind[Orion/1.4.8 (build 10374)]._iib._vfd(Unknown Source)
> > at
> > > > com.evermind[Orion/1.4.8 (build 10374)]._iib._qjc(Unknown Source)
> > > > -
> > > >
> > > > In the loadLocale() I got this on my console after starting my app
> > server.
> > > > The name line is the properties files being found, obviously my
> > > > ~/WEB-INF/classes/cais.properties (configured in my web.xml) is not
> > being
> > > > found.
> > > >
> > > > Anyone know right off where I should be looking in order to find
this
> > stuff.
> > > >
> > > > --
> > > > cassia(build):/u/public/orion# java -jar orion.jar
> > > > Auto-unpacking /u/build/release/cais.ear... done.
> > > > Auto-unpacking /u/build/release/cais/cais-web.war... done.
> > > > Auto-deploying cais (Assembly had been updated)...
> > > > Auto-deploying cais-ejb.jar (ejb-jar.xml had been touched since the
> > previous
> > > > deployment)... done.
> > > > Orion/1.4.8 initialized
> > > > Auto-deploying CAIS (Assembly had been updated)...
> > > > n

Re: Reducing the burden on ActionServlet.

2001-04-28 Thread Jonathan Asbell
Title: Reducing the burden on ActionServlet.



Isnt it true that if you have 10 users you would 
have 10 instances of the ActionServlet?  I believe it is not a singleton 
and that you always have an instance of the servet for each threaded 
request.

  - Original Message - 
  From: 
  Tewathia, Atul 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Friday, April 27, 2001 11:44 
  PM
  Subject: Reducing the burden on 
  ActionServlet.
  
  In our project we have more than one hundred jsp 
  (each having an average of 2 or 3 forms )and we have already decided to use 
  struts as our framework. Now the dilema :- We found that managing such a large 
  number of jsp from a single stuts-config.xml file will be a huge  burden. 
  Plus, it seems the ActionServlet will be hard pressed always, as a controller. 
  Considering both these facts we realize that there should be a mechanism to 
  share the load of servlet through some way. Though this can be achieved by 
  using more than one servlet , we don't want to use this solution because it is 
  highlt complex considering the projects interwoven functional 
  requirements.Is there some way by which we can accomplish an efficient way 
  to manage a large number of jsp files and to increase the performance by 
  reducing load on the servlet.
  Thanking in advance. 



Re: Possiblility Answer to: html form widgets not appearing

2001-04-29 Thread Jonathan Asbell

Your right, I read it wrong
Quoting from
http://jakarta.apache.org/struts/userGuide/building_view.html#i18n

"The important thing is for the resource bundle to be found on the class
path for your application. Another approach is to store the
MyResources.properties file in your application's class folder. You can then
simply specify "myResources" as the application value. "

However, what I said is true about the "user.dir" value.  For security
reasons, when using Weblogic, Tomcat etc. , your can not make relative
references to a file from a servlet.  They  have to be absolute, or relative
to the "user.dir".



- Original Message -
From: "Jason Chaffee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 28, 2001 2:08 PM
Subject: Re: Possiblility Answer to: html form widgets not appearing


> It shouldn't be a class path problem because it is trying to load the
resource
> within the web app, which should never be in the class path to begin with.
It
> is more likely a bug with the app server.
>
> Jonathan Asbell wrote:
>
> > It sounds like you have a "classpath problem".  I bet you either have a
> > system classpath (ie a classpath set in your
> > settings/controlpanel/system/advanced/environmentvariables assuming
it
> > is a pc) which conflicts with the classpath you start up when you run
your
> > server.  Either way it seems that it cant find your file in the
classpath to
> > load.  Try to loop through and print to the console all of your system
> > variables at the point after you start up your server. (cut and paste
class
> > below)
> > What you are looking for is the following system properties:
> > "java.class.path"
> > "user.dir"
> > Put your properties in the directory that indicates your "user.dir".  If
it
> > works than your problem is your classpath.
> > 
> > import java.util.*;
> > public class DisplayEnvironment{
> >  public static void main(String[] args){
> >   new DisplayEnvironment();
> >  }
> >  public DisplayEnvironment(){
> >   System.out.println("");
> >   displaySystemProperties();
> >   System.out.println("");
> >   displayWeblogicProperties();
> >   System.out.println("");
> >  }
> >  private void displaySystemProperties(){
> >   Properties p = System.getProperties();
> > Set set = p.keySet();
> > Object[] o = set.toArray();
> > List l = Arrays.asList(o);
> > Collections.sort(l);
> > Iterator i = l.iterator();
> >   while(i.hasNext()){
> >String s = (String)i.next();
> >System.out.println(s + " " + p.getProperty(s));
> >System.out.println("");
> >   }//while
> >  }//method
> >  private void displayWeblogicProperties(){
> >  }
> > }
> > 
> >
> > - Original Message -
> > From: "Jason Chaffee" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, April 28, 2001 1:30 AM
> > Subject: Re: html form widgets not appearing
> >
> > > The app server is the container for the servlet, so all of servlet
code is
> > being
> > > done by the app server, therefore if something is implemented wrong
like
> > > getServletContext() or something, than you will have a problem.
Weblogic
> > has
> > > all kinds of bugs like this.
> > >
> > > "G.L. Grobe" wrote:
> > >
> > > > Are you sure it's up to the app server to pass the found resources
to
> > > > struts. I thought I passed over some code where struts did the
reading
> > of
> > > > params from web.xml? Therefore making it a struts problem.
> > > >
> > > > - Original Message -
> > > > From: "Jason Chaffee" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Friday, April 27, 2001 11:59 PM
> > > > Subject: Re: html form widgets not appearing
> > > >
> > > > > If you have everything set correctly as you say, there might be a
bug
> > with
> > > > you app
> > > > > server and its ability to find resources.
> > > > >
> > > > > &quo

Lookup performance on ActionMappings

2001-04-29 Thread Jonathan Asbell



Our company manages almost 100 related sites, 
some with 3 million+ /month viewership.  In thinking about how I would 
approach the ActionServlet I am suspicious that the lookup time of the 
ActionMapping might become unsatisfactory when you reach a certain 
number of mappings.  Does anyone have any statistics?  Would you all 
suggest a servlet for each site in this case?  Keep in mind that all fo the 
sites share the common core enterprise framework.


Correctly using token mechanism

2001-04-29 Thread Jonathan Asbell



After studying how the token mechanism works, I 
understand the following:
 
1) The token is a unique identifier (value) which 
may be found in the Session and Request, which is used with certain form 
submissions.
 
2) It is created, if it does not already 
exist, by an Action object that wants to use one, and its value is 
subsequently put in the session.
 
3) Its value is taken from Session by and 
used in conjunction with an org.apache.struts.taglib.html.FormTag as a hiden 
form field value.
 
4) When the form is submitted, the token's value in 
the submitted form request is compared to the value of the token sitting in the 
Session.  If they are equal than the Action may be processed.
 
QUESTION 1:  In what situation should we use 
the token mechanism, as it seems that in the Struts example not all form actions 
need it.
 
QUESTION 2:  At what 
strategic point should the token be created for use, as it seems like one Action 
creates it and another Action looks for it and uses 
it?


Status of "autobeans" in Struts

2001-04-29 Thread Jonathan Asbell



I can see in the mail list that the inclusion 
of Thors "autobean" into Struts is still under consideration, but in the dev 
list and in Ted's clippings form the mail list I get the impression that it has 
been implemented already (refering to the section "Automatic/Extended 
Properties, autobeans").  Has it been tested / examined?  has anyone 
found any problems with using it?


Re: dynamically build HTML forms

2001-05-05 Thread Jonathan Asbell

I want to know about this too.  I think this may be old.

- Original Message -
From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 05, 2001 1:50 PM
Subject: dynamically build HTML forms


> Hi,
>
> I came across the following statement:
>
> "The Struts framework lacks what is called "dynamic properties", or the
> ability to use meta data to drive the creation of forms and the associated
> ActionForm. This means it is impractical to dynamically build a HTML form
> using a separate, predefined data source (such as a XML file or database
> table). When a project requires database-driven form design it would be
best
> to design special Model I-based JSP pages for this task. Keep in mind, it
is
> still possible to use Struts in other areas of your project. The Struts
team is
> well aware of this limitation arising from the lack of "dynamic
properties."
> This feature is planned for version 1.1 of Struts."
> (http://www.jspinsider.com/tutorials/jsp/struts/strutsadvance.html)
>
> But what I'd like to do is precisely this: Creating HTML forms
dynamically. Is
> there another way besides using Model 1-based JSP pages for this task?
>
> I appreciate any clue in this matter.
>
> TIA
> __
> Hartmut Bernecker
> Heinrich-Rorbeck-Weg 30
> 73614 Schorndorf
> Tel. 0 71 81 / 25 75 39
> Fax. 0 71 81 / 25 75 41
> [EMAIL PROTECTED]
> __
>




Re: Suggestion/Idea for tag: Iterate ResultSets

2001-05-06 Thread Jonathan Asbell

Result sets ARE tied to the connection in a way.  Some DB drivers throw
exceptions when you try to manipulate data while you still have a pointer to
rows.  At work we were trying to manipulate a stream which was pointing to
an output parameter in a stored proc while the connection was open.  The
result was that we had to convert the stream into another object (String in
our case) and close the connection just to manipulate the data.

- Original Message -
From: "Mindaugas Idzelis" <[EMAIL PROTECTED]>
To: "struts" <[EMAIL PROTECTED]>
Sent: Sunday, May 06, 2001 9:33 PM
Subject: Suggestion/Idea for  tag: Iterate ResultSets


> I just thought up of an excellent idea (although, I wasn't the only one).
> Use the iterate tag to iterate over the rows of a resultset. The column
meta
> data could be exposed as beans named as the column name. A 
> operation would display the data in the column.
>
> I did a search about this topic in the mailing list archive, and I found
> this message:
>
> http://marc.theaimsgroup.com/?l=struts-user&m=98269295229785&w=2
>
> It talk about ResultSets being tied to connections. This is not the case.
> ResultSets are tied to the statements that produced them, and as far as I
> can tell, statements are not closed when the connection is closed.
>
> Other than that, It should be easy to change the iterate tag to support
> resultsets. If anyone is interested in helping me extend or develop a tag
> for this purpose, please message me.
>
> --min
>




Re: Struts questions for evaluation

2001-05-07 Thread Jonathan Asbell

I am interested in the code.   Please send.

> Hello Struts users,
>
> We are currently evaluating Struts and other web (MVC) frameworks and
would like to ask you some questions:
>
> - Is there some struts-config XML-generation from some
>   modeling tool (Rose for instance) ?
>
>   We would like to design a state or activity diagram in
>   such a tool then generate the navigation XML file.
>
> - Can struts behave like a real state machine ?
>
>   i.e. how to ensure that some Action is performed only if
>   another Action (or view but is not ideal) has been
>   performed with some result (success to be simple). We
>   would like this to be Struts-controlled, not developper-
>   controlled (check session variables, etc.).
>
>   We found the built-in Struts token system but this seem
>   only to be used to demarcate transactions in a set of
>   views. This allow to demarcate a transaction end (token
>   value change) but not an inconstency within the
>   transaction (i.e. i valide twice the first page of the
>   transaction) as the token value will not change.

I hit the same weakness of struts a few months ago and I enhanced some
struts
classes in order to be able for each action to specify which action has to
precede this action. This allows you to implement some kind of control flow.
For
instance you can now define an action that displays a logon page
(displayLogon)
and specify in the next action (logonAction, which gets executed when the
user
presses the submit button of the logon page) that displayLogon needed to be
executed directly before. This is more powerful than the token mechanism.

What I also did at the same time is an enhanced user authentication checking
for
each action. You can now specify a different user authorization class for
each
action, so you can easily implement a very fine grained user authorization.

Exceptions (either control flow or user authentication exceptions) are
handled
by the framework and cause a forward to different error pages.

I plan to propose this enhancement to the struts developer's group after
release
1.0 is out. If you are interested in the meantime I can send you the code.

> - Why does the struts-example perform some scoped-
>   variables cleanup at the end of every Action ?
>
>   As these variables are defined as scoped in the struts-
>   config XML file, they should naturally live during the
>   specified scope lifetime. We don't understand that in the
>   struts-example (maybe this is not mandatory).

My understanding is: For request scope you normally do not need to clean up,
because the object gets removed automatically, when the request is served.
For
the session scope you pretty often want to remove e. g. a form bean, when it
is
no longer needed to keep your session data lean.

> Thank you very much for your informations about Struts.
>
>   Laurent.

--- Matthias
- Original Message -
From: "Matthias Bauer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 07, 2001 4:05 AM
Subject: Re: JDBC driver specific functionality/GenericConnections


> > Hello,
> >
> > I would like to access functionality specific to the MM MySql driver in
an
> > application that uses Struts' datasource pool and am having a bit of
> > troubling casting a GenericConnection back to an
> > org.gjt.mm.mysql.Connection. Casting from a GenericConnection to an
> > org.gjt.mm.mysql.Connection results in a class cast exception; casting a
> > Statement or PreparedStatement generated by the GenericConnection
produces a
> > null pointer exception. I am working with Struts 1.0-beta-1 and MM Mysql
> > 2.0.4.
> >
> > If it sheds any light on the problem, the MM function I would like to
access
> > is PreparedStatement.getLastInsertID(). Has anyone successfully
prosecuted
> > this?
>
> You must not cast GenericConnection to  What you really want to do is call
> DataSource.getConnection which returns a Connection object like so:
>
>   DataSource ds = getServlet().findDataSource(null);
>   Connection con = ds.getConnection();
>
> You can cast this connection to org.gjt.mm.mysql.Connection without any
> problems!
>
>
> > On a tangential note--why is the getConnection() method in
GenericConnection
> > private? Were it public, I assume I could use it to get an MM Connection
and
> > execute MySql specific functions to my heart's content.
>
> You should never need to call GenericConnection.getConnection()! What you
want
> to do is always call DataSource.getConnection(), as stated above.
>
> > Thanks is advance,
> > David
>
> Hope this helps,
>
> --- Matthias
>




Struts & Weblogic 5.2 sp10

2001-10-05 Thread Jonathan Asbell



3 issues
 
1) Maybe the build is bad, but I had to recompile 
ActionForm and put it in my applications classes directory to get rif of 
the "Cannot find ActionMappings ActionMappings or ActionFormBeans collection" 
while using Weblogic 5.1 sp10
 
2)When I forward from a jsp page outside of the 
WEB-INF directory to a jsp page inside the WEB-INF directory, Weblogic tells me 
that it cant recognize the resource "/WEB-INF/mydirectory/myfile.jsp".  

 
3)To access a jsp inside of WEB-INF dont you have 
to have atleast ONE jsp outside of the WEB-INF to start the process.  
Otherwise there is no way to access a jsp.


Re: html:errors

2001-10-19 Thread Jonathan Asbell

IN YOUR ACTION
ActionErrors errors = new ActionErrors();
if (myBoolean){errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.password.mismatch"));

IN YOUR RESULTING JSP PAGE



- Original Message -
From: "storck" <[EMAIL PROTECTED]>
To: "User Struts (E-Mail)" <[EMAIL PROTECTED]>
Sent: Friday, October 19, 2001 7:10 AM
Subject: html:errors


> Hi,
>
> COULD you help me!
> Is there a possibility to write the ONLY the error for a CERTAIN property
of
> a FormBean out at a possition where I want it?
> I have something in mind where I have a form with different inputfields
and
> if a field has a wrong value than I have a message under that field wich
> tells me what is wrong!
> Does someone has a (complete) example how I can mannage that? I think I
saw
> that some time ago but I dont know where anymore and for what I should
> search for!
>
> MANY thanks!
>




~~ Confusion with triggering an Action ~~

2001-10-22 Thread Jonathan Asbell



in my jsp page http://localhost/sports/trivia.jsp I 
have a Struts form 
 
Considering this, the following is 
true:
1) the directory I am currently in is 
"/sports"
2) the request I am submitting to is 
"/processTrivia.do"
 
When I create my mapping inside struts-config.xml 
 the action is not triggered when 
the form submits.  This is because for some reason I have to match to the 
path "/sports/processTrivia".  This does not make sense to me, because I am 
actually submitting to "/processTrivia" inside my form, and not 
"/sports/processTrivia" even though I am actually in the "/sports" 
directory.  When I submit a form to "/processTrivia.do", I expect that it 
will actually submit to "root-slash-processTrivia".  Can someone clarify 
this.  I have mentioned this before and noone seemed to respond.  In 
addition, my collegues also feel this is misleading.  The result is that I 
have to make mapping entries for this action in each level of the directory 
where I want this service.


Re: ~~ Confusion with triggering an Action ~~

2001-10-22 Thread Jonathan Asbell



My default web application is not "/sports", but 
rather just "localhost".  If the site was live the web app would be "http://www.mysite.com", and I would be in the 
"/sports" directory.  What can I do to get the behavior I am 
expecting?

  - Original Message - 
  From: 
  Brett 
  Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 9:42 
  PM
  Subject: RE: ~~ Confusion with triggering 
  an Action ~~
  
  /processTrivia.do is in fact "root-slash-processTrivia" - but in 
  relation to your current context. If your webapp is named sports, then it will 
  have to be /sports/processTrivia.do
   
  How 
  you get around this depends on your servlet container. In Tomcat 4, you could 
  make sports the default webapp, so /processTrivia.do would go to the sports 
  webapp. Other containers probably have a similar method. However, I don't 
  recommend any of these, especially if you have multiple web 
  applications.
   
  Cheers,
  Brett
  
-Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 11:38 
AMTo: [EMAIL PROTECTED]Subject: ~~ 
Confusion with triggering an Action ~~Importance: 
High
in my jsp page http://localhost/sports/trivia.jsp I 
have a Struts form 
 
Considering this, the following is 
true:
1) the directory I am currently in is 
"/sports"
2) the request I am submitting to is 
"/processTrivia.do"
 
When I create my mapping inside 
struts-config.xml  the action 
is not triggered when the form submits.  This is because for some 
reason I have to match to the path "/sports/processTrivia".  This does 
not make sense to me, because I am actually submitting to "/processTrivia" 
inside my form, and not "/sports/processTrivia" even though I am actually in 
the "/sports" directory.  When I submit a form to "/processTrivia.do", 
I expect that it will actually submit to "root-slash-processTrivia".  
Can someone clarify this.  I have mentioned this before and noone 
seemed to respond.  In addition, my collegues also feel this is 
misleading.  The result is that I have to make mapping entries for this 
action in each level of the directory where I want this 
  service.


Re: ~~ Confusion with triggering an Action ~~

2001-10-22 Thread Jonathan Asbell



currently weblogic 5.1 sp 10, with the default 
webapp set as I mentioned

  - Original Message - 
  From: 
  Brett 
  Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 9:58 
  PM
  Subject: RE: ~~ Confusion with triggering 
  an Action ~~
  
  I'm 
  talking about webapps from the perspective of the servlet specification. I 
  don't think it's the same thing. (Think WAR files, WEB-INF 
  subdirectories)
  Some 
  servlet containers don't support/require this structure so you may not be 
  using them (eg older WebLogic).
   
  What 
  container/servlet spec. are you using?
   
  Cheers,
  Brett
  
-----Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 11:53 
AMTo: [EMAIL PROTECTED]Subject: Re: ~~ 
Confusion with triggering an Action ~~
My default web application is not "/sports", 
but rather just "localhost".  If the site was live the web app would be 
"http://www.mysite.com", and I would be 
in the "/sports" directory.  What can I do to get the behavior I am 
expecting?

  - Original Message - 
  From: 
  Brett Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 9:42 
  PM
  Subject: RE: ~~ Confusion with 
  triggering an Action ~~
  
  /processTrivia.do is in fact "root-slash-processTrivia" - but in 
  relation to your current context. If your webapp is named sports, then it 
  will have to be /sports/processTrivia.do
   
  How you get around this depends on your servlet container. In 
  Tomcat 4, you could make sports the default webapp, so /processTrivia.do 
  would go to the sports webapp. Other containers probably have a similar 
  method. However, I don't recommend any of these, especially if you have 
  multiple web applications.
   
  Cheers,
  Brett
  
-Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 
11:38 AMTo: [EMAIL PROTECTED]Subject: 
~~ Confusion with triggering an Action ~~Importance: 
High
in my jsp page http://localhost/sports/trivia.jsp I 
have a Struts form 
 
Considering this, the following is 
true:
1) the directory I am currently in is 
"/sports"
2) the request I am submitting to is 
"/processTrivia.do"
 
When I create my mapping inside 
struts-config.xml  the 
action is not triggered when the form submits.  This is because for 
some reason I have to match to the path "/sports/processTrivia".  
This does not make sense to me, because I am actually submitting to 
"/processTrivia" inside my form, and not "/sports/processTrivia" even 
though I am actually in the "/sports" directory.  When I submit a 
form to "/processTrivia.do", I expect that it will actually submit to 
"root-slash-processTrivia".  Can someone clarify this.  I have 
mentioned this before and noone seemed to respond.  In addition, my 
collegues also feel this is misleading.  The result is that I have 
to make mapping entries for this action in each level of the directory 
where I want this 
service.


Re: ~~ Confusion with triggering an Action ~~

2001-10-22 Thread Jonathan Asbell



here is the ONLY setting I made in 
weblogic.properties:
weblogic.httpd.defaultWebApp=D:/myapp
 
Everything else came preinstalled that 
way
 
 

  - Original Message - 
  From: 
  Brett 
  Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 10:25 
  PM
  Subject: RE: ~~ Confusion with triggering 
  an Action ~~
  
  If 
  you got more sp10 to work, more power to you. It leaks about 1gb of RAM an 
  hour for me :)
   
  Have 
  you got something like this?
   
  weblogic.httpd.webApp.strutsexample=c:/jakarta-struts/webapps/struts-example.war 
  
   
  
  Or 
  are you just using a servletclasses/ type set up?
   
  If 
  you are using the first, my first instructions still hold. If you are doing a 
  lot of servlet configurations in weblogic.properties, then I'm not sure 
  because that will completely change the way it works. I haven't used struts 
  with that older method before.
   
  Cheers,
  Brett
  
-Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 12:17 
PMTo: [EMAIL PROTECTED]Subject: Re: ~~ 
Confusion with triggering an Action ~~
currently weblogic 5.1 sp 10, with the default 
webapp set as I mentioned

  - Original Message - 
  From: 
  Brett Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 9:58 
  PM
  Subject: RE: ~~ Confusion with 
  triggering an Action ~~
  
  I'm talking about webapps from the perspective of the servlet 
  specification. I don't think it's the same thing. (Think WAR files, 
  WEB-INF subdirectories)
  Some servlet containers don't support/require this structure so you 
  may not be using them (eg older WebLogic).
   
  What container/servlet spec. are you 
using?
   
  Cheers,
  Brett
  
    -Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 
11:53 AMTo: [EMAIL PROTECTED]Subject: 
Re: ~~ Confusion with triggering an Action ~~
My default web application is not 
"/sports", but rather just "localhost".  If the site was live the 
web app would be "http://www.mysite.com", and I would be 
in the "/sports" directory.  What can I do to get the behavior I am 
expecting?

  - Original Message - 
  From: 
  Brett Porter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 22, 2001 
  9:42 PM
  Subject: RE: ~~ Confusion with 
  triggering an Action ~~
  
  /processTrivia.do is in fact "root-slash-processTrivia" - but 
  in relation to your current context. If your webapp is named sports, 
  then it will have to be /sports/processTrivia.do
   
  How you get around this depends on your servlet container. In 
  Tomcat 4, you could make sports the default webapp, so 
  /processTrivia.do would go to the sports webapp. Other containers 
  probably have a similar method. However, I don't recommend any of 
  these, especially if you have multiple web 
  applications.
   
  Cheers,
  Brett
  
-Original Message-From: Jonathan Asbell 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, 23 October 2001 
11:38 AMTo: 
[EMAIL PROTECTED]Subject: ~~ Confusion with 
triggering an Action ~~Importance: 
High
in my jsp page http://localhost/sports/trivia.jsp I 
have a Struts form 
 
Considering this, the following is 
true:
1) the directory I am currently in is 
"/sports"
2) the request I am submitting to is 
"/processTrivia.do"
 
When I create my mapping inside 
struts-config.xml  the 
action is not triggered when the form submits.  This is because 
for some reason I have to match to the path 
"/sports/processTrivia".  This does not make sense to me, 
because I am actually submitting to "/processTrivia" inside my form, 
and not "/sports/processTrivia" even though I am actually in the 
"/sports" directory.  When I submit a form to 
"/processTrivia.do", I expect that it will actually submit to 
"root-slash-processTrivia".  Can someone clarify this.  I 
have mentioned this before and noone seemed to respond.  In 
addition, my collegues also feel this is misleading.  The 
result is that I have to make mapping entries for this action in 
each level of the directory where I want this 
  service.