Old questions that die hard

2001-02-10 Thread Jim Richards


I've been out of the Struts loop for a few weeks (or months, or years based on
Internet time) and I am impressed that almost everything is ready for a 1.0
release, which means Craig's comments below still stand, re: Multipage forms
and forms built dynamically. The other thing I haven't found reference to yet is
client side validation (but I also haven't looked that hard either)

I'll have to start digging deep again.

Craig wrote:
>My thinking on multi-page forms is definitely not totally finished yet, but my
>operating assumption has been that you'd have separate actions for each page, so
>you could therefore direct errors back to the individual pages.  The logical
>"grouping" of the actions could happen by subclassing a common base class that
>represented the shared logic.  You would declare the same form bean for all of
>these actions, and you'd store this bean in session scope.  (As a side benefit,
>you can also use "next" and "previous" logical forward names directly, without
>having to calculate which page you are on in sequence, and then know what the
>next and previous logical names are.)
>
>It is still messy, because the validation method (at least) needs to know what
>fields came from what pages, and there is no convenient way to communicate that
>information so that it only needs to be specified once.  I think that a final
>solution to this is probably going to need to wait for a 1.1 time frame, when we
>can figure out how to deal with it cleanly.  I believe that the current approach
>works quite well for single page forms (with the outstanding issue of people
>that want to deal with dynamic sets of properties, rather than fixed ones, which
>will need to be a separate extension if we decide to support it).


--
Mary had a crypto key
 she kept it in escrow
  and everything that Mary said
the Feds were sure to know.



Re: I18n

2001-02-10 Thread Craig R. McClanahan



Sean Giles wrote:
Thanks
Craig I'm using Jrun 3.0 and downloaded the service pak and the session.setAtttribute(Action.Locale_key,
now seems to be working.
From a design
standpoint what is the best way to set the locale information regardless
of browser or machine settings to build the initial Accept-language header? 
Another servlet that reads a cookie and builds the headers before directing
the request to the struts action servlet?
 
A persistent cookie is the only way I can think of to know the user's preference
before they log on.
In a Servlet 2.3 environment, this would be a perfect task for a Filter,
which could examine each request for a persistent cookie, and set the Locale
based on that cookie's values if it was not there yet.  You could,
of course, automatically log the user on as well.
 
Basically I
have a requirement for a user to be able to switch between languages on
the fly but also being able to set an initial locale preference when they
log in.  The struts framework handles the switching without a problem
(which is really cool) its the initial display that I'm wondering about
since they may have us_english for a machine setting, browser setting for
spanish and an initial application locale preference for French.
 
In the absence of being able to use Filters, the only thing I can think
of would be to create your own specialized version of the 
tag that looked for the persistent cookie and set the locale appropriate,
if the cookie was there and the Locale was not set yet.  You'd also
want to create your own custom subclass of ActionServlet, and override
the processLocale() method to do the same thing, in case the initial request
was sent to a "*.do" URI instead of to a JSP page.
 
Thanks again,
Sean
 
Craig
PS:  I'm going to segregate the locale setting code in HtmlTag
into a separate method so that it is easier to subclass this class.
 
 




Re: I18n

2001-02-10 Thread Sean Giles


Thanks Craig I'm using Jrun 3.0 and downloaded the service pak and the session.setAtttribute(Action.Locale_key, now seems to be working. 

From a design standpoint what is the best way to set the locale information regardless of browser or machine settings to build the initial Accept-language header?  Another servlet that reads a cookie and builds the headers before directing the request to the struts action servlet?

Basically I have a requirement for a user to be able to switch between languages on the fly but also being able to set an initial locale preference when they log in.  The struts framework handles the switching without a problem (which is really cool) its the initial display that I'm wondering about since they may have us_english for a machine setting, browser setting for spanish and an initial application locale preference for French.

Thanks again,
Sean


On Sat, 10 Feb 2001 12:38:24 -0800, Craig R. McClanahan wrote:
>Sean Giles wrote:
>
>> How can I set the locale for each individual user session before the first
>> page displays?
>>
>> I've tried putting the session.setAtttribute(Action.Locale_key,) but
>> it always displays in the default locale of the machine?  Changing the
>> machine locale causes the correct properties file to be used so I know that
>> is not the problem.
>>
>
>In the Struts example app, this is done by including the following tag on the
>index.jsp page (actually, on every page):
>
>  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>  
>  ... page content ...
>  
>
>This causes that  tag to consult the "Accept-Language" header sent by
>the browser, and set up a Locale in the user's session if it is not already
>there -- exactly the same way that the controller servlet does this if you
>configure it to.
>
>NOTE:  There are currently problems with this on servlet containers that do not
>correctly implement the JSP 1.1 requirements for converting custom tag attribute
>values.  I have heard problem reports about JRun 3.0 and ATG in this regard.
>
>>
>> Thanks
>> Sean Giles
>
>Craig



-- Sean Giles, [EMAIL PROTECTED] on 02/10/2001




RE: [Q] TRANSACTION_TOKEN_KEY - Multiple Page Forms

2001-02-10 Thread Neal Kaiser

Thanks, that makes sense. I'm using that design pattern now. Do you have any
prefered
design patterns for multiple page forms.  For example, if your Registration
example was spanned
over 3 different JSPs, where would you put the logic that knows what page to
validate, and what page to  forward to?  Would you use hidden tags? Would
you use different action paths? (ie saveRegistration.do would be
saveRegistration1.do, saveRegistration2.do, etc)  Just wondering the best
way...

Thanks.

> -Original Message-
> From: Dan Malks [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 10, 2001 3:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Q] TRANSACTION_TOKEN_KEY
>
>
>
>
> "Craig R. McClanahan" wrote:
>
> > Dan Malks wrote:
> >
> > > Craig,
> > >
> > > "Craig R. McClanahan" wrote:
> > >
> > > > Neal Kaiser wrote:
> > > >
> > > > > How does this work when they are registering for the
> first time, not
> > > > > editing. I can
> > > > > see that in EditRegistrationAction the token is
> set... but if they are
> > > > > registering
> > > > > for the first time where is the token set? It seems
> that it would fail when
> > > > > it hits
> > > > > the token check in SaveRegistrationAction, but I know
> it doesn't, so it must
> > > > > be set
> > > > > somewhere, right?
> > > > >
> > > >
> > > > You will note that the "Register with the MailReader
> Demonstration Application"
> > > > link (on index.jsp) goes through "EditRegistration.do"
> as well, so that the
> > > > token gets saved even in this case.  The
> "?action=Create" request parameter is
> > > > used to distinguish this from the editing case ("?action=Edit").
> > >
> > > Would 'ModifyRegistration.do' or 'ProcessRegistration.do'
> be more clear, then?
> > >
> >
> > Or even something more generic like "StartRegistration.do"?
>  Can you tell that I wrote
> > the "edit" use case first?  :-)
> >
> > I had a Comp Sci prof that said the most critical design
> decision you will ever make
> > is naming things.
>
> And often, surprisingly, one of the harder ones.
>
>
> > And, even when you get the initial name correct, it is important to
> > review your names after the program has evolved a bit.
>
> Amen ;-)
>
> Thanks,
> -dm
>
>
> >  Sounds like it is time to do
> > that exercise on the example app.
> >
> > >
> > > -dm
> > >
> >
> > Craig
>
> --
> Dan Malks Sun Java Center
> Enterprise Java Architect703.208.5794
>
>




Re: [Q] TRANSACTION_TOKEN_KEY

2001-02-10 Thread Dan Malks



"Craig R. McClanahan" wrote:

> Dan Malks wrote:
>
> > Craig,
> >
> > "Craig R. McClanahan" wrote:
> >
> > > Neal Kaiser wrote:
> > >
> > > > How does this work when they are registering for the first time, not
> > > > editing. I can
> > > > see that in EditRegistrationAction the token is set... but if they are
> > > > registering
> > > > for the first time where is the token set? It seems that it would fail when
> > > > it hits
> > > > the token check in SaveRegistrationAction, but I know it doesn't, so it must
> > > > be set
> > > > somewhere, right?
> > > >
> > >
> > > You will note that the "Register with the MailReader Demonstration Application"
> > > link (on index.jsp) goes through "EditRegistration.do" as well, so that the
> > > token gets saved even in this case.  The "?action=Create" request parameter is
> > > used to distinguish this from the editing case ("?action=Edit").
> >
> > Would 'ModifyRegistration.do' or 'ProcessRegistration.do' be more clear, then?
> >
>
> Or even something more generic like "StartRegistration.do"?  Can you tell that I 
>wrote
> the "edit" use case first?  :-)
>
> I had a Comp Sci prof that said the most critical design decision you will ever make
> is naming things.

And often, surprisingly, one of the harder ones.


> And, even when you get the initial name correct, it is important to
> review your names after the program has evolved a bit.

Amen ;-)

Thanks,
-dm


>  Sounds like it is time to do
> that exercise on the example app.
>
> >
> > -dm
> >
>
> Craig

--
Dan Malks Sun Java Center
Enterprise Java Architect703.208.5794





Re: I18n

2001-02-10 Thread Craig R. McClanahan

Sean Giles wrote:

> How can I set the locale for each individual user session before the first
> page displays?
>
> I've tried putting the session.setAtttribute(Action.Locale_key,) but
> it always displays in the default locale of the machine?  Changing the
> machine locale causes the correct properties file to be used so I know that
> is not the problem.
>

In the Struts example app, this is done by including the following tag on the
index.jsp page (actually, on every page):

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

... page content ...


This causes that  tag to consult the "Accept-Language" header sent by
the browser, and set up a Locale in the user's session if it is not already
there -- exactly the same way that the controller servlet does this if you
configure it to.

NOTE:  There are currently problems with this on servlet containers that do not
correctly implement the JSP 1.1 requirements for converting custom tag attribute
values.  I have heard problem reports about JRun 3.0 and ATG in this regard.

>
> Thanks
> Sean Giles

Craig





Re: [Q] TRANSACTION_TOKEN_KEY

2001-02-10 Thread Craig R. McClanahan

Dan Malks wrote:

> Craig,
>
> "Craig R. McClanahan" wrote:
>
> > Neal Kaiser wrote:
> >
> > > How does this work when they are registering for the first time, not
> > > editing. I can
> > > see that in EditRegistrationAction the token is set... but if they are
> > > registering
> > > for the first time where is the token set? It seems that it would fail when
> > > it hits
> > > the token check in SaveRegistrationAction, but I know it doesn't, so it must
> > > be set
> > > somewhere, right?
> > >
> >
> > You will note that the "Register with the MailReader Demonstration Application"
> > link (on index.jsp) goes through "EditRegistration.do" as well, so that the
> > token gets saved even in this case.  The "?action=Create" request parameter is
> > used to distinguish this from the editing case ("?action=Edit").
>
> Would 'ModifyRegistration.do' or 'ProcessRegistration.do' be more clear, then?
>

Or even something more generic like "StartRegistration.do"?  Can you tell that I wrote
the "edit" use case first?  :-)

I had a Comp Sci prof that said the most critical design decision you will ever make
is naming things.  And, even when you get the initial name correct, it is important to
review your names after the program has evolved a bit.  Sounds like it is time to do
that exercise on the example app.

>
> -dm
>

Craig





Re: Struts/Motif

2001-02-10 Thread Craig R. McClanahan

See intermixed.

Dan Connelly wrote:

> Struts for Motif.  Okay, wash my mouth out with SOAP!
>
> But, look, lots of neat, old X/Motif applications were written using the MVC
> architecture.
>
> What good did it do X, Motif, ... or MVC?
>
> And, don't try blaming it all on the X Server being such a heavy "client".
> On the other hand, don't try to claim that the Web-way is the only way.
>
> [We could also consider Struts for Swing, but that clouds the argument I am
> about to make.]
>
> A Motif MVC app I recently worked on had MVC features similar to Struts,
> like an action map "digester".  Well, the Motif app digester was written in
> awk and it was a preprocessor.  The mappings got compiled into the code.
> But it was similar, a nice high level view of the internal data
> architecture.
>
> Unfortunately, I also see some disturbing similarities between the
> weaknesses of MVC Motif (as commonly programmed) and Struts, such as
>

Well, that is what you get for using a version 1.0 product :-)

The tag set to date has been focused on getting the most basic possible
functionality completed and standardized, so that people can use it.  Now that
we are nearly there, we can start thinking in earnest about future directions.
I've got a few "crystal ball" comments scattered below about where I would like
to see us go next.

>
> 1.   A difficult and impoverished widget set.
>
> For instance, do we have a high-level Tree widget to plug into Struts?
> Having third-party Tree widgets and scripting hacks for Trees didn't make
> Motif competitive with the Win-mill.  ( ?? "COMpetitive"  ??)
>

I see two different development directions here:

* Fancier general purpose tags or tag sets (ok, "widgets" for you GUI hackers
:-)
  like a tree, that can be easily configured with custom tags -- and interacting

  with the bean model and other tags that already exist.

* Application-specific tags that know how to render specific kinds of objects
  in a variety of ways that can be configured with attributes or nested
elements.

>
>  2.  Ad hoc Database-to-Model mappings.
>
> For instance, if a number of browser sessions, perhaps hierarchically
> related browser sessions, are looking at the same Persistent EJBs, how do
> these sessions coordinate their separate (hierarchical) Models?  Their
> database updates?  Their screen Updates?   Is this to be left to the realm
> of "Business Logic"?   It's system logic, for sure.It invites trouble to
> let the bit jockeys be responsible for getting this right, for buggering the
> MVC.
>

Session management is certainly an area where we can do a *lot* more to assist
app developers get it right.

General database-to-model mappings already exist in many forms, and to some
degree it doesn't matter which ones you wish to use with Struts.  I'm not yet
convinced we need to annoint a particular package as the "one and only" for
Struts use, but we should start creating examples that explore the abilities of
various packages.

>
> The Motif MVC app I worked on used the windowing hieirachy in X/Motif to
> build a Model hierarchy of database views.  This was very ad hoc, very
> quirky and quite buggy, but nice.  Or so I thought.   The nuances escaped
> many in the user community.  And, eventually the programmers also lost track
> of the ad hoc programming needed to sustain the Model hierarchy.   So it
> goes.
>

Just as we can get more sophisticated in our support for the "view" component of
MVC, you are asking here for more sophistication in the "model" component.  This
is an area of interest to me, and I also have some colleagues at Sun that would
be interested in expanding and codifying design patterns for interactions
between web tier applications and EJB-based back ends.

Already on the 1.1 TODO list is some thoughts about possible improvements in the
"controller" component as well, with the idea of workflows (scripted processing
of finer grained logic components than Actions) and event listeners.

>
> But, jeez, it did make for a very lively GUI when it all went well, with
> model changes rippling from window to window.  Made Win-doze apps look
> absolutely static in comparison.  Unfortunately, I don't see much (yet) in
> Struts to make a more dynamic display out of (hierarchical) web browser
> sessions.   Or, is this just a feature in search of an audience??
>

I don't think so -- I think you're seeing the results of "beginning at the
beginning" so far :-).  Continuing to use Windows as an example, it took them
three major revs to even get close to doing this entire picture correctly.
We've got the opportunity to take advantage of emerging web technologies, plus
an open source development model, so there's a potential to move pretty fast.

Future developments in Struts are going to be exciting -- but, at the same time,
I'm going to do my absolute best to make sure we don't de-support folks who
build apps on 1.0 by changing APIs in incompatible ways.

>
> Dan Connelly

Craig





Re: JspException

2001-02-10 Thread Craig R. McClanahan

"Allamsetty, Venkata" wrote:

> > Hi,
> >
> > I am trying to get my first Struts application work.
> > I have created defaultTime.jsp which contains a text input for time,
> > DefaultTimeForm , EditDefaultTimeAction and SaveDefaultTimeAction classes.
> > Defined web.xml and struts-config.xml and deployed them appropriately.
>

You are not showing us the JSP page or struts-config.xml file that is running,
but I suspect the problem is one of the following:

* You are creating the bean in one scope, but looking for it in a different
scope.

* You are creating the bean in request scope, and looking for it on a
  later request (request scope beans only survive through the current
  request).


> >
> > But when I try loading it, I get Error 500.
> > and the message is
> >
> > javax.servlet.jsp.JspException: No bean found under attribute key
> > defaultTimeActionForm
> > at
> > org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.jav
> > a:214)
> > at
> > org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:90)
> > at
> > org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTa
> > gBase.java:218)
> > at jsp_servlet._defaulttime._jspService(_defaulttime.java:85)
> > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> >
> If I try loading the editDefaultAction.do directly, I get the
> follwing error.
>
> javax.servlet.jsp.JspException: Exception accessing property action
> for bean defaultTimeActionForm: java.lang.NoSuchMethodException: Unknown
> property 'action'

If your bean includes property="action", the tag is going to try to call the
getAction() method on whatever bean was selected by the "name" (and optional
"scope") attributes.  Does the bean have such a method?

>
> at
> org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:
> 234)
> at
> org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:90)
> at
> org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagB
> ase.java:218)
> at
> jsp_servlet._defaulttime._jspService(_defaulttime.java:85)
>
> Any hints or suggestions?
>
> thanks
>
> > Venkata Allamsetty
> >

Craig





Re: Digester: How to read the body of a tag?

2001-02-10 Thread Craig R. McClanahan

Jens Rehpöhler wrote:

> Hello Craig,
>
> as always you gave the conclusive hint. Perhaps you should add an example of the 
>usage of
> this methods to the documentation. It would make things much more clearer.
>

Good idea.  I'm adding an example of using this technique to the Developer's Guide 
page on the
Digester module.  The example will be based on processing a web application deployment
descriptor (web.xml) file, where almost everything is passed as body content rather 
than XML
attributes.

Look for this in tonight's nightly build.

>
> thanks,
>
> Jens
>

Craig





Re: [Q] TRANSACTION_TOKEN_KEY

2001-02-10 Thread Dan Malks


Craig,

"Craig R. McClanahan" wrote:

> Neal Kaiser wrote:
>
> > How does this work when they are registering for the first time, not
> > editing. I can
> > see that in EditRegistrationAction the token is set... but if they are
> > registering
> > for the first time where is the token set? It seems that it would fail when
> > it hits
> > the token check in SaveRegistrationAction, but I know it doesn't, so it must
> > be set
> > somewhere, right?
> >
>
> You will note that the "Register with the MailReader Demonstration Application"
> link (on index.jsp) goes through "EditRegistration.do" as well, so that the
> token gets saved even in this case.  The "?action=Create" request parameter is
> used to distinguish this from the editing case ("?action=Edit").

Would 'ModifyRegistration.do' or 'ProcessRegistration.do' be more clear, then?

-dm

>
>
> This is a design pattern that I like a lot -- use the same Action to initialize
> the input form when you are creating a new record or when editing an existing
> one, and use a request parameter to define which type of transaction is
> occurring.  You will also find that the "action" request parameter gets included
> as a property of the form bean, and is passed in (as a hidden variable) on the
> input form so that SaveRegistrationAction knows what to do as well.
>
> Craig

--
Dan Malks Sun Java Center
Enterprise Java Architect703.208.5794





Re: [Q] TRANSACTION_TOKEN_KEY

2001-02-10 Thread Craig R. McClanahan

Neal Kaiser wrote:

> How does this work when they are registering for the first time, not
> editing. I can
> see that in EditRegistrationAction the token is set... but if they are
> registering
> for the first time where is the token set? It seems that it would fail when
> it hits
> the token check in SaveRegistrationAction, but I know it doesn't, so it must
> be set
> somewhere, right?
>

You will note that the "Register with the MailReader Demonstration Application"
link (on index.jsp) goes through "EditRegistration.do" as well, so that the
token gets saved even in this case.  The "?action=Create" request parameter is
used to distinguish this from the editing case ("?action=Edit").

This is a design pattern that I like a lot -- use the same Action to initialize
the input form when you are creating a new record or when editing an existing
one, and use a request parameter to define which type of transaction is
occurring.  You will also find that the "action" request parameter gets included
as a property of the form bean, and is passed in (as a hidden variable) on the
input form so that SaveRegistrationAction knows what to do as well.

Craig





I18n

2001-02-10 Thread Sean Giles

How can I set the locale for each individual user session before the first
page displays?

I've tried putting the session.setAtttribute(Action.Locale_key,) but
it always displays in the default locale of the machine?  Changing the
machine locale causes the correct properties file to be used so I know that
is not the problem.

Thanks
Sean Giles



Struts/Motif

2001-02-10 Thread Dan Connelly


Struts for Motif.  Okay, wash my mouth out with SOAP!

But, look, lots of neat, old X/Motif applications were written using the MVC
architecture.

What good did it do X, Motif, ... or MVC?

And, don't try blaming it all on the X Server being such a heavy "client".
On the other hand, don't try to claim that the Web-way is the only way.

[We could also consider Struts for Swing, but that clouds the argument I am
about to make.]

A Motif MVC app I recently worked on had MVC features similar to Struts,
like an action map "digester".  Well, the Motif app digester was written in
awk and it was a preprocessor.  The mappings got compiled into the code.
But it was similar, a nice high level view of the internal data
architecture.


Unfortunately, I also see some disturbing similarities between the
weaknesses of MVC Motif (as commonly programmed) and Struts, such as



1.   A difficult and impoverished widget set.

For instance, do we have a high-level Tree widget to plug into Struts?
Having third-party Tree widgets and scripting hacks for Trees didn't make
Motif competitive with the Win-mill.  ( ?? "COMpetitive"  ??)

 2.  Ad hoc Database-to-Model mappings.

For instance, if a number of browser sessions, perhaps hierarchically
related browser sessions, are looking at the same Persistent EJBs, how do
these sessions coordinate their separate (hierarchical) Models?  Their
database updates?  Their screen Updates?   Is this to be left to the realm
of "Business Logic"?   It's system logic, for sure.It invites trouble to
let the bit jockeys be responsible for getting this right, for buggering the
MVC.


The Motif MVC app I worked on used the windowing hieirachy in X/Motif to
build a Model hierarchy of database views.  This was very ad hoc, very
quirky and quite buggy, but nice.  Or so I thought.   The nuances escaped
many in the user community.  And, eventually the programmers also lost track
of the ad hoc programming needed to sustain the Model hierarchy.   So it
goes.

But, jeez, it did make for a very lively GUI when it all went well, with
model changes rippling from window to window.  Made Win-doze apps look
absolutely static in comparison.  Unfortunately, I don't see much (yet) in
Struts to make a more dynamic display out of (hierarchical) web browser
sessions.   Or, is this just a feature in search of an audience??


Dan Connelly





RE: JspException

2001-02-10 Thread Allamsetty, Venkata


> Hi,
> 
> I am trying to get my first Struts application work. 
> I have created defaultTime.jsp which contains a text input for time,
> DefaultTimeForm , EditDefaultTimeAction and SaveDefaultTimeAction classes.
> Defined web.xml and struts-config.xml and deployed them appropriately.
> 
> But when I try loading it, I get Error 500.
> and the message is 
> 
> javax.servlet.jsp.JspException: No bean found under attribute key
> defaultTimeActionForm
> at
> org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.jav
> a:214)
> at
> org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:90)
> at
> org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTa
> gBase.java:218)
> at jsp_servlet._defaulttime._jspService(_defaulttime.java:85)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> 
If I try loading the editDefaultAction.do directly, I get the
follwing error.

javax.servlet.jsp.JspException: Exception accessing property action
for bean defaultTimeActionForm: java.lang.NoSuchMethodException: Unknown
property 'action'
at
org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:
234)
at
org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:90)
at
org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagB
ase.java:218)
at
jsp_servlet._defaulttime._jspService(_defaulttime.java:85)


Any hints or suggestions?

thanks

> Venkata Allamsetty
> 



JspException

2001-02-10 Thread Allamsetty, Venkata


Hi,

I am trying to get my first Struts application work. 
I have created defaultTime.jsp which contains a text input for time,
DefaultTimeForm , EditDefaultTimeAction and SaveDefaultTimeAction classes.
Defined web.xml and struts-config.xml and deployed them appropriately.

But when I try loading it, I get Error 500.
and the message is 


Venkata Allamsetty




RE: [Q] TRANSACTION_TOKEN_KEY

2001-02-10 Thread Neal Kaiser

How does this work when they are registering for the first time, not
editing. I can
see that in EditRegistrationAction the token is set... but if they are
registering
for the first time where is the token set? It seems that it would fail when
it hits
the token check in SaveRegistrationAction, but I know it doesn't, so it must
be set
somewhere, right?



> -Original Message-
> From: Rob Leland [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 09, 2001 9:52 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [Q] TRANSACTION_TOKEN_KEY
>
>
> EditRegistrationAction.java  SaveRegistrationAction.java
> provide examples.
>
> You would probably never use generateToken().
>
> It is used whenever you want to prevent the user
> from bookmarking a page, or from using the browser
> back arrow and then posting a second time.
>
> In the EditRegistrationAction, once the data is loaded
> from a database a call to saveToken() is made. It should
> probably be named 'setToken()' to be consistent with
> 'resetToken()'. This sets a variable in both the session
> and request scope of the app. Control is then forwarded
> to the edit jsp. When the user 'posts' the page the
> Token is validated in SaveRegistrationPage, then it is
> destroyed by the 'resetToken call. Then the next page is
> 'forwarded' to. If at this time the user hits the 'back'
> button and hits 'post' again, when SaveRegistrationAction
> checks to see if the token is valids it finds can find
> one of two things:
>   1) Either the 'Token' variable didn't exist in the session scope.
>  This happen if 'resetToken' was the last method called
>   2) Or it will find that the "request" and "session" scope
> Token do not
> match.
>  This happen if 'saveToken' was the last method called.
>
>
> Alexander Staff wrote:
> >
> > Hello,
> > does anyone here have any examples/explanations about using the
> > TRANSACTION_TOKEN_KEY feature in struts ?
> > I am not sure using the generateToken(), isTokenValid(),
> resetToken() and
> > saveToken() functions properly and in the right place.
> >
> > Thanks in advance
> > Ciao
> > Alexander
> >
> > --
> > Sent through GMX FreeMail - http://www.gmx.net




Re: bean-cookie.jsp

2001-02-10 Thread Matthias Kerkhoff

Hello Hal,

> The jsp 1.1 spec implies that the jsp:useBean tag does not need to be used
> before using jsp:getProperty.

That's correct. The 1.1 errata and the 1.2 spec make this even more explicit.

> Either the struts documentation should be changed to be less emphatic about
> the use of jsp:useBean or the bean-cookie.jsp should be changed to be nice
> to Weblogic. It could use bean:write only and not use jsp:getProperty. I
> have always assumed the bean:cookie tag didn't work in Weblogic 6.0 because
> the bean:cookie test page didn't work. Maybe there should be a separate test
> page to assess the ability of a jsp engine to use jsp:getProperty for beans
> defined by means other than jsp:useBean. That seems like something the J2EE
> certification suite should test for rather than struts. 

 does not work, because Weblogic does not implement the spec
correctly. There are a couple of things that should be done from my point
of view:

a) Notify BEA and request a fix
  (done three months ago for WLS 5.1, unsure what's with WLS6.0)

b) Until Bea supplies a fix, fix it on your own
  (done for WLS 5.1, see my mails from yesterday)
  
c) Change the test page(s) (applies to bean-cookie; logic-match; logic-present)
  They will fail on any container, if no cookie is present. The tag should use
  the value="FOO" attribute to get a default for missing cookies.
  (supplied updated JSPs yesterday to STRUTS-DEV, see my mail titled
   "struts-test w/ URLRewriting (Patch to enable...)" )

d) Change the test page, if you don't like a) and b) to gracefully catch,
  print and explain exceptions to the user.
  I think that a test-suite should not fail completly on a known bug. Either
  the bug should be fixed, or the suite should catch the error, print and
  explain it. People new to Struts may otherwise immediatly stop looking
  further into it, because it really doesn't matter to them where the
  exception comes from.

Matthias(mailto:[EMAIL PROTECTED])





Re: Digester: How to read the body of a tag?

2001-02-10 Thread Jens Rehpöhler

Hello Craig,

as always you gave the conclusive hint. Perhaps you should add an example of the usage 
of
this methods to the documentation. It would make things much more clearer.

thanks,

Jens

"Craig R. McClanahan" wrote:

> Jens Rehpöhler wrote:
>
> > Hello Steven,
> >
> > I think I didn't described my problem correctly. Parsing the properties of a tag 
>works
> > well. But I want to parse the content between some tags. For example:
> >
> > 
> > 
> > this is the value i want to initialize my class with
> > 
> > 
> >
> > With the addSetProperties method I can parse the propertie of the user tag, but I
> > can't parse the content between the  tag.
>
> The rules that are *supposed* to work for this would be:
>
> digester.addCallMethod("database/user/text", "setText", 1);
> digester.addCallParam("database/user/text", 0);
>
> Translated into English, these rules state that, whenever the specified pattern is
> encountered:
> * Set up a call to the setText(String text) method of the
>   object on the top of the call stack
> * Set the zeroth parameter (i.e. the only one) to the
>   body content of this element
>
> With other variations of the addCallParam() method, you can take parameter values 
>from
> certain attributes of this element as well.
>
> Craig McClanahan