Re: Any way to pass parameters to the JDBC driver?

2002-02-05 Thread Antony Stace

> try adding them as qeurystrings to the db url...
I tried

  
url="jdbc:postgresql://localhost/ereal?file.encoding=SJIS&user.language=ja"

but I get an exception.  Is this what you meant?

Cheers 

Tony$B!#(B

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Any way to pass parameters to the JDBC driver?

2002-02-05 Thread Mikkel Bruun
 
try adding them as qeurystrings to the db url...

mikkel
-Original Message-
From: Antony Stace
To: [EMAIL PROTECTED]
Sent: 06-02-2002 08:56
Subject: Any way to pass parameters to the JDBC driver?

Hi

Is there anyway I can pass the parameters

 -Dfile.encoding=SJIS -Duser.language=ja 

to the JDBC postgres driver via the struts-config.xml file.


  

  

Cheers

Tony




-- 


Cheers

Tony?
-


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Expert guidance required for Configuring Struts. !! S O S !!

2002-02-05 Thread Mikkel Bruun

Hi,

Im currently running struts on the 4.1 server...took me some time tp set it
up though...

disclaimer:
- Im not using taglibs...I have been able to configure them, but i cant
remember how (!)...
- i have mapped the actionservlet to /action instaed of .do...but .do should
be possible...

I'll see if I can get the time to make a write up of my findings that may
assist you...

You could start by focusing on the taglibs now, and recieve my document
later...

Mikkel

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 06-02-2002 06:26
Subject: Expert guidance required for Configuring Struts. !! S O S !!
Importance: High

Some one please respond!

I have been posting this for quite sometime... I need urgent assistance
on
configuring Struts on iPlanet 4.1 Enterprise edition. Please suggest
some
online documentation or manuals for the same... Struts home page hasn't
got
any

Thanks

Jayanta Roy

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Any way to pass parameters to the JDBC driver?

2002-02-05 Thread Antony Stace
Hi

Is there anyway I can pass the parameters

 -Dfile.encoding=SJIS -Duser.language=ja 

to the JDBC postgres driver via the struts-config.xml file.


  

  

Cheers

Tony




-- 


Cheers

Tony$B!#(B
-


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Antony Stace

> The only I can advise is "Check your DataBase's encoding".
> In postgres, you can check by :
>  select getdatabaseencoding()
> In your case, should be "EUC-JP".

Should this be EUC-JP or SHIFT_JIS?  All my jsp files are in SHIFT_JIS format.

testdb=# select getdatabaseencoding();
 getdatabaseencoding 
-
 SQL_ASCII
(1 row)

testdb=# 
Looks like this should be something different.  

> 
> I think there are many pitfalls in servlet and JSP using with Japanese besides the 
>above.
> So if you can read Japanese, I'll introduce you the most useful site for such kind 
>of problems :
>  http://www.ingrid.org/java/jserv/i18n/corruptedchar.html

I shall take a look.

Cheers

Tony


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Yoshinori Ashizawa

Tony:
>I have forms on my jsp pages, the values of these I need to store into a database.  
>When I store 
>them in a postgres database and then retrieve them they are garbage characters.  Are 
>there any special 
steps I need to
>do to store them in the database?

Sorry, I'm not so familiar with postgress.
However I think there are not so many considerations when we use JDBC with multi-byte 
charactar now.

The only I can advise is "Check your DataBase's encoding".
In postgres, you can check by :
 select getdatabaseencoding()
In your case, should be "EUC-JP".

I think there are many pitfalls in servlet and JSP using with Japanese besides the 
above.
So if you can read Japanese, I'll introduce you the most useful site for such kind of 
problems :
 http://www.ingrid.org/java/jserv/i18n/corruptedchar.html

-
Yoshinori Ashizawa 
 (A member of Ja-Jakarta : http://www.ingrid.org/jajakarta )

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Can anyone help me how to unsubscribe

2002-02-05 Thread Antony Stace
Kicha

What does sending mail to

[EMAIL PROTECTED]

do?


On Wed, 06 Feb 2002 11:41:54 +0530
Krishnamoorthy <[EMAIL PROTECTED]> wrote:

> Actually I tried in all the possible ways to unsubscribe.
> Not only me lots of other guys are tring to do it.but no use ,
> could anyone help us to unsubscribe from struts.
> 
> Thanks
> Kicha
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 


-- 


Cheers

Tony$B!#(B
-


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Can anyone help me how to unsubscribe

2002-02-05 Thread Krishnamoorthy

Actually I tried in all the possible ways to unsubscribe.
Not only me lots of other guys are tring to do it.but no use ,
could anyone help us to unsubscribe from struts.

Thanks
Kicha


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Expert guidance required for Configuring Struts. !! S O S !!

2002-02-05 Thread Thomas Paul

And this page didn't help?

http://jakarta.apache.org/struts/installation-ip.html

--- [EMAIL PROTECTED] wrote:
> Some one please respond!
> 
> I have been posting this for quite sometime... I
> need urgent assistance on
> configuring Struts on iPlanet 4.1 Enterprise
> edition. Please suggest some
> online documentation or manuals for the same...
> Struts home page hasn't got
> any


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Expert guidance required for Configuring Struts. !! S O S !!

2002-02-05 Thread jayanta . roy

Some one please respond!

I have been posting this for quite sometime... I need urgent assistance on
configuring Struts on iPlanet 4.1 Enterprise edition. Please suggest some
online documentation or manuals for the same... Struts home page hasn't got
any

Thanks

Jayanta Roy

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question about ActionForm's validate method

2002-02-05 Thread Alex Paransky

So do you mean, all pages go through the Action?  Even those which are not
forms and for display purposes only?  Could you shed some light as to why
this is preferred?

Thanks.

-AP_
http://www.alexparansky.com


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:02 PM
To: Struts Users Mailing List
Subject: Re: Design question about ActionForm's validate method


The best practice now is to use ActionMappings for everything, so that
the reqeust passes through the controller.

This buys you several important capabilities that become important as
applications grow. Not the least of which is the new support for
multiple applications in the Nightly Build.

The ActionMapping has a validate property that you can use to turn off
validation when the mapping is used to initialize a new form. So,
typically, you will have an ActionMapping for each circumstance.


name="itemForm"
scope="request"
validate="false">


   



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Sid Stuart wrote:
>
> Hi,
>
> I've stumbled across a subtle problem/design question that I don't see
> mentioned in the documentation.
>
> The ActionForm's validate method can be configured to verify form data
> from a page and generate error messages which may then be displayed on
> the page for the user to see. This works fine when the user has accessed
> the page by specifying a JSP file in the URL. When the user accesses the
> page by calling the Action directly though, the validate method is
> called before the user ever sees the page, much less inputs valid data
> to the form. This leads to an unfortunate display of unwarranted error
> messages.
>
> It would be nice if the documentation would provide a rule such as:
> If one plans on the user calling the Action directly in the URL  then
> one should not use the automatic validation provided by ActionForm.
>
> Further, as having two different procedures to generate a page can lead
> to subtle errors, one should decide whether a page will be accessed as a
> JSP or as an Action and design for the one scenario. The simplest (and
> safest) design rule will be to access all pages through either one
> mechanism or the other.
>
> Comments?
>
> Sid Stuart

--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Antony Stace
On Wed, 06 Feb 2002 13:17:41 +0900
Yoshinori Ashizawa <[EMAIL PROTECTED]> wrote:

> Antony Stace:
> >I converted my ApplicationResources.properties file by
> >
> >nfk -s ApplicationResources.properties > a ; mv a ApplicationResources.properties
> 
> In that case you should use "native2ascii" command instead of "nkf".
> I guess nkf cannot convert into unicode.
> 
> Please Take a look at :
>  http://java.sun.com/j2se/1.3/docs/guide/intl/index.html
> and look at "TOOLS" section.
> 
> >I am not sure of the "-encoding" option.  Where do I use this?
> 
> For instance, 
>  native2ascii -encoding SJIS ApplicationResources.properties 
>  (for UNIX)

Thanks

native2ascii -encoding EUC-JP ApplicationResources.properties a ; mv a 
ApplicationResources.properties 

worked!
I have forms on my jsp pages, the values of these I need to store into a database.  
When I store 
them in a postgres database and then retrieve them they are garbage characters.  Are 
there any special steps I need to
do to store them in the database?


Cheers

$B%H%K!<(B


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


[off topic] Collaborative Development Tools

2002-02-05 Thread Matthew O'Haire

Hi,

Please excuse the off-topic post, but there are clearly some switched-on
developers in this group.

I was wondering if anyone could recommend a good collaborative development
environment.  

I'm looking for something along the lines of SourceCast
http://www.collab.net/products/sourcecast and SourceForge
http://www.vasoftware.com/sf but without the steep cost!

Thanks,
Matt O'Haire




Re: Wizard Interface question

2002-02-05 Thread Ian Duggan


> Session persistence across app servers would be an issue anyways if
> you put anything in the session would it not? So are you suggesting that if
> a project might migrate from single app server to multiple, then nothing
> should be in session scope? If atleast some objects are stored in session,
> then the solution that allows all app servers to access the same session
> should take care of everything.
> 
> We haven't used multiple app servers and we are in the early stages of
> development on our project so I would really appreciate any feedback

Usually things are setup so that all requests belonging to a certain
session are redirected back to the same appserver. This is done through
the webserver forwarding module, which does some inspection of the
incoming requests to see which appserver to forward the request to.

If you really must have the session on all appservers, there are a
couple of strategies that involve having the appservers replicate the
session around. There are various ways of doing this, but it is usually
not needed.

-- Ian

~~
Ian Duggan[EMAIL PROTECTED]
  http://www.ianduggan.net

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Configuring Struts on iPlanet 4.1 EE

2002-02-05 Thread jayanta . roy

Hi,

This is real urgent, I need to configure Struts on iPlanet Enterprise
Edition. I want some reference material, document that would help me do this
and any Online reference material for Struts first timers...

Thanks in advance,

Jayanta Roy

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




MultipartRequestHandler Question

2002-02-05 Thread Sean Willson

I had a few questions I was hoping someone could help me answer. I need
to write my own request handler for file transfering into Struts. We do
not want to write files to disk when a file transfer occurs, instead we
want to place that file on some remote server. Rather than use a two
step approach of uploading to temp file, and then transfering to the
remote server we want to immediatly transfer the file to the remote
server, as it is coming in. On to the questions:

1. In looking at the current DiskMultipartRequestHandler I can't tell
 whether or not the request that is handed and parsed by the
 MulitpartIterator is already uploaded and complete or is still
 maybe uploading. Since it is reading a stream I assume that the
 request may not be complete yet. Is this correct? Use case, user
 wants to upload a 10MB file. This posting of that file kicks off
 a MultipartRequestHandler of some kind ... is that file already
 100% ready when it gets to that point or is it still uploading?

2. My thought process would be to modify the handleRequest method in
 the DiskMultipartRequestHandler to create some
 CustomMultipartIterator who's createLocalFile method (if I were to
 name it simular to the current iterator) would instead of creating a
 local file open a connection to that other server and begin
 transfering the bytes as they are read in. Anyone see any holes in
 this?

If anyone has any insight, comments, concerns, or suggestions about this
please let me know.

Thanks,
Sean


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Yoshinori Ashizawa
Antony Stace:
>I converted my ApplicationResources.properties file by
>
>nfk -s ApplicationResources.properties > a ; mv a ApplicationResources.properties

In that case you should use "native2ascii" command instead of "nkf".
I guess nkf cannot convert into unicode.

Please Take a look at :
 http://java.sun.com/j2se/1.3/docs/guide/intl/index.html
and look at "TOOLS" section.

>I am not sure of the "-encoding" option.  Where do I use this?

For instance, 
 native2ascii -encoding SJIS ApplicationResources.properties 
 (for UNIX)
or
 native2ascii -encoding MS932 ApplicationResources.properties
 (for Windows)

Change encoding name according to your encoding character. See below:
 http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html

-
Yoshinori Ashizawa 
 (A member of Ja-Jakarta : http://www.ingrid.org/jajakarta )





$B02Bt(B $B2EE5(B(Yoshinori Ashizawa)NTT$B%G!<%?@hC<5;=Q3t<02qmailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 


Re: speed of struts

2002-02-05 Thread Pete Carapetyan

I have had the same problem on one very large form with lots of back end tag 
processing. Would be interested to know if anyone had performed any profiling on 
similar situations to identify where the bottlenecks were.

Struts wrote:

> I found out that if I include a lot of html form fields in a form (over 50). The jsp 
>pages seems to be awfully slow to load (almost 10 seconds). I made it a little bit 
>faster when I converted all radio button sets to drop down list, still it is very 
>slow. The speed to load up seems to exponentially related to the number of form 
>fields.
>
> Has anybody got the same problem?
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
Pete Carapetyan
http://datafundamentals.com
Java Development Services

Open standards technology for commercial profitability



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




speed of struts

2002-02-05 Thread Struts

I found out that if I include a lot of html form fields in a form (over 50). The jsp 
pages seems to be awfully slow to load (almost 10 seconds). I made it a little bit 
faster when I converted all radio button sets to drop down list, still it is very 
slow. The speed to load up seems to exponentially related to the number of form fields.

Has anybody got the same problem?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread RyotaFukasawa
The reading SHIFT_JIS/EUC-JP outside-property file on java required
exec "native2ascii" command (including jdk) to convert multi-byte charactar to
unicode charctar.

Try native2ascii command to application resources file's charactor convert.

#for build.xml example in ant

---




  

---

>Hi
>
>I have an application resources file in my struts project,
>
>START web.xml snip--
>
>  application
>  ApplicationResources
>
>END web.xml snip--
>
>this ApplicationResources.properties is in SHIFT_JIS format.  When I use a
>property from this file I get weird characters.  Other Japanese characters
>on this page which are in the jsp file display fine.  Does anyone know
>how I can correct this problem. 
>
>
>-- 
>
>
>Cheers
>
>Tony$B!#(B
>-
>
>
>_
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>


Ryota Fukasawa
EC Solution Department
Web Solution Division
FUJITSU SOCIAL SCIENCE LABORATORY Ltd.
TEL: +81-44-739-1535 FAX: +81-44-739-1545
E-mail adress: [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Antony Stace
$B$"$j$,$H$&(B $B$4$6$$$^$7$?(B 

On Wed, 06 Feb 2002 11:53:29 +0900
Yoshinori Ashizawa <[EMAIL PROTECTED]> wrote:

> Have you tried to convert your application resources file into Unicode encoded 
>(\u notation) 
> file?

I converted my ApplicationResources.properties file by

nfk -s ApplicationResources.properties > a ; mv a ApplicationResources.properties

> 
> When you use resources file written with other encoding charaters,
> you should convert that using "native2ascii" command.
> 
> If you are not in Shift_JIS environment, don't forget "-encoding" option.

I am not sure of the "-encoding" option.  Where do I use this?


-- 


Cheers

Tony$B!#(B
-


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Problems with SHIFT_JIS application properties file

2002-02-05 Thread Yoshinori Ashizawa
Have you tried to convert your application resources file into Unicode encoded (\u 
notation) 
file?

When you use resources file written with other encoding charaters,
you should convert that using "native2ascii" command.

If you are not in Shift_JIS environment, don't forget "-encoding" option.

-
Yoshinori Ashizawa 
 (A member of Ja-Jakarta : http://www.ingrid.org/jajakarta )

 
Antony Stace:
>Hi
>
>I have an application resources file in my struts project,
>
>START web.xml snip--
>
>  application
>  ApplicationResources
>
>END web.xml snip--
>
>this ApplicationResources.properties is in SHIFT_JIS format.  When I use a
>property from this file I get weird characters.  Other Japanese characters
>on this page which are in the jsp file display fine.  Does anyone know
>how I can correct this problem. 
>
>
>-- 
>
>
>Cheers
>
>Tony$B!#(B
>-

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Form Action

2002-02-05 Thread Victor Hadianto

Or escapes the double quotes, for example:

 ">


-- 
Victor Hadianto
---
Is it possible that software is not like anything else, 
that it is meant to be discarded: that the whole point is to 
always see it as a soap bubble?


On Wed,  6 Feb 2002 13:27, you wrote:
> Try using single quotes for the  attributes.
>
> For example:
> 
>
> or construct the action first and store it in a variable, and
> then access it as needed using double quotes.
>
> For example:
> <%
>
>  String action = new
> StringBuffer("/jitzu/purchase.action?order=yes&format=")
>   .append(request.getParameter("format"))
>   .append("&type=")
>   .append(request.getParameter("type"))
>   .toString();
>
> %>
>
> 
>
>
> I haven't tested this code, but its my best educated guess.
>
> HTH,
>
> robert
>
> >
> >
> > Hello All,
> >
> > I am trying to use the  tag for a form in a jsp page. But the
> > action attribute for the form is dynamically constructed from the
> > request.
> >
> > I have tried using jsp request object to construct the action
> > part like this
> >
> >  > request.getParameter("format") + "&type=" + request.getParameter("type")
> > %>">
> >
> > But this is giving an error as pasted below
> >
> > Error: 500
> > Location: /jitzu/purchase.jsp
> > Internal Servlet Error:
> > org.apache.jasper.compiler.ParseException:
> > C:\jakarta-tomcat-3.3\webapps\jitzu\purchase.jsp(36,25) Attribute  has no
> > value
> > at org.apache.jasper.compiler.JspReader.parseAttributeValue(Unknown
> > Source)
> > at org.apache.jasper.compiler.JspReader.parseTagAttributes(Unknown
> > Source)
> > at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
> > at org.apache.jasper.compiler.Parser.parse(Unknown Source)
> > at org.apache.jasper.compiler.Parser.parse(Unknown Source)
> > at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
> > . more stack trace ...
> >
> > I would like to know if I can create the action part dynamically
> > ?? if yes,
> > how to do it??


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Form Action

2002-02-05 Thread Robert Taylor

Try using single quotes for the  attributes.

For example:


or construct the action first and store it in a variable, and
then access it as needed using double quotes.

For example:
<%

 String action = new
StringBuffer("/jitzu/purchase.action?order=yes&format=")
  .append(request.getParameter("format"))
  .append("&type=")
  .append(request.getParameter("type"))
  .toString();

%>




I haven't tested this code, but its my best educated guess.

HTH,

robert

> -Original Message-
> From: Satish Jeejula [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 9:06 PM
> To: '[EMAIL PROTECTED]'
> Subject: Form Action
>
>
> Hello All,
>
> I am trying to use the  tag for a form in a jsp page. But the
> action attribute for the form is dynamically constructed from the request.
>
> I have tried using jsp request object to construct the action
> part like this
>
>  request.getParameter("format") + "&type=" + request.getParameter("type")
> %>">
>
> But this is giving an error as pasted below
>
> Error: 500
> Location: /jitzu/purchase.jsp
> Internal Servlet Error:
> org.apache.jasper.compiler.ParseException:
> C:\jakarta-tomcat-3.3\webapps\jitzu\purchase.jsp(36,25) Attribute  has no
> value
>   at org.apache.jasper.compiler.JspReader.parseAttributeValue(Unknown
> Source)
>   at org.apache.jasper.compiler.JspReader.parseTagAttributes(Unknown
> Source)
>   at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
>   at org.apache.jasper.compiler.Parser.parse(Unknown Source)
>   at org.apache.jasper.compiler.Parser.parse(Unknown Source)
>   at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
>   . more stack trace ...
>
> I would like to know if I can create the action part dynamically
> ?? if yes,
> how to do it??
>
> Thanks,
> Satish
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problems with SHIFT_JIS application properties file

2002-02-05 Thread Antony Stace
Hi

I have an application resources file in my struts project,

START web.xml snip--

  application
  ApplicationResources

END web.xml snip--

this ApplicationResources.properties is in SHIFT_JIS format.  When I use a
property from this file I get weird characters.  Other Japanese characters
on this page which are in the jsp file display fine.  Does anyone know
how I can correct this problem. 


-- 


Cheers

Tony$B!#(B
-


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Form Action

2002-02-05 Thread Satish Jeejula

Hello All,

I am trying to use the  tag for a form in a jsp page. But the
action attribute for the form is dynamically constructed from the request.

I have tried using jsp request object to construct the action part like this

">

But this is giving an error as pasted below

Error: 500
Location: /jitzu/purchase.jsp
Internal Servlet Error:
org.apache.jasper.compiler.ParseException:
C:\jakarta-tomcat-3.3\webapps\jitzu\purchase.jsp(36,25) Attribute  has no
value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(Unknown
Source)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(Unknown
Source)
at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
at org.apache.jasper.compiler.Parser.parse(Unknown Source)
at org.apache.jasper.compiler.Parser.parse(Unknown Source)
at org.apache.jasper.compiler.Parser$Tag.accept(Unknown Source)
. more stack trace ...

I would like to know if I can create the action part dynamically ?? if yes,
how to do it??

Thanks,
Satish

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: RE: Design question about ActionForm's validate method

2002-02-05 Thread ykphuah

Hi,

I think there is some misconfiguration issue, as far as I know,
there are two kind of actions in Struts, EditAction and
SaveAction. For my implementation, all the EditAction
have validate=false in the struts-config.xml and all the
SaveAction have validate=true.

EditAction took care of 2 operations, edit and add, for
add, it just instantiate an object, for edit operation, it have
to load the values from the persistence layer (loading from JSP
is surely a very ugly thing to do.).

So for EditAction, its just plainly creating and loading,
no validation is neccessary, for SaveAction, then we need
validation.

CHeers,
Yee Keat

- Original Message -
From: "Robert Scaduto" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>
Sent: Feb 6, 2002 2:31:19 AM GMT+08:00
Subject: RE: Design question about ActionForm's validate method

>Matt,
>
>I also disagree that you should only use actions when
submitting a form.  I
>also believe that in most cases you should never forward a
request directly
>to a jsp without first going through the Action framework.
>
>Struts provides a utility action that will do this for you. 
The
>org.apache.struts.actions.ForwardAction will forward to the
jsp file
>specified in the parameter attribute of the action mapping.
Like so..
>
>   type="org.apache.struts.actions.ForwardAction"
>   parameter="/password_assistance.jsp">
>
>
>If you are using the *.do extension in your servlet mapping
you would access
>the action like this...
>
>Go to Password
>Assistance
>
>It may seem like extra work for no reason but if the
requirements of your
>system change and now you need to forward to an action instead
of a jsp it
>is much easier to replace the ForwardAction to a custom
action.
>
>It sounds to me like you are on the right track.
>
>-Rob
>
>-Original Message-
>From: Matt Read [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 05, 2002 12:59 PM
>To: Struts Users Mailing List
>Subject: RE: Design question about ActionForm's validate
method
>
>
>I'm fairly new to struts (well, about 24 hours actually) and
this message
>touches on a concept that I've having trouble grasping.
>
>Are you saying that your site should never allow the user to
navigate to a
>URL that maps to an Action unless you are submitting a form?
>
>This is my example and although it's actually working in
practice it doesn't
>really feel right to me and doesn't conform to above rule. I
hope I've
>included enough detail and would appreciate any clues on good
design.
>
>1. User goes to the home page and clicks on a "Find a client"
link.
>2. This link points to "/find/client.do" which is defined as
an
>ActionMapping as follows:
>  type="mysite.actions.FindClientAction"
>   name="clientFindForm"
>   scope="request"
>   input="/pages/findclient.jsp">
>   
>   
>3. The code in FindClientAction ensures that the user is
authenticated and
>then populates some request scoped attributes that enabled
>/pages/findClient.jsp to function correctly.
/pagesfindClient.jsp displays a
>form to allow the user to enter search criteria.
>4. The submit action for the form in /pages/findClient.jsp is
>"/find/getresults" which is defined as an ActionMapping as
follows:
>   type="mysite.actions.FindClientResultsAction"
>   name="clientFindForm"
>   scope="request"
>   input="/pages/findclient.jsp">
>   
>
>5. The code in FindClientResultsAction examines the contents
of the
>clientFindForm and contstructs a SQL statement to retrieve the
correct data.
>6. /pages/findClientResults.jsp renders the results from the
database.
>
>Matt.
>
>-Original Message-
>From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
>Sent: 05 February 2002 17:44
>To: Struts Users Mailing List
>Subject: Re: Design question about ActionForm's validate
method
>
>
>
>I made this same 'mistake'.
>
>Actions MUST only be called when a form is submitted.   Never
to generate
>the JSP.  Thats why they are called actions.
>
>Or two put it another way, you do need several URL's
>
>a) URL to JSP on a GET
>b) URL to action the POST
>
>The easiert way to do it is to have all forwards going
directly to the JSP,
>and all actions in the pages going to .do.
>
>At first it seems rubish, but then you hopefully buy into the
model view
>controller idea.  i.e NO business logic in the page and it all
starts to
>make perfect sence.   But you really do have to buy into it
otherwise you
>are fighting urge to ditch it all and go back to brilliant
servlets, nice
>and easy, total power etc etc.
>
>Jonathan
>
>
> Message
>History 
>
>
>From: Sid Stuart <[EMAIL PROTECTED]> on 05/02/2002 09:24 PST
>
>Please respond to "Struts Users Mailing List"
>

Re: Logic:iterate

2002-02-05 Thread Arron Bates

Try the nested extension. All relevant tags can nest properly, amongst 
iterate tags or otherwise.

It's in the nightly build, or you can go here for a version for Struts 
1.0/1.01. Also has some docco, tutorial etc...
http://www.keyboardmonkey.com/struts


Arron.

Marcelo Caldas wrote:

>Hi,
> 
>I have a  tag, where I'm trying to create indexed  . this 
>part if fine... My problem is that the labels for each field are also part of my bean 
>being iterated (internationalization and type of  I'm asking the user... just 
>in case you're wandering). But, I just realized that  does not accept the 
>indexed="true" attribute...
>
>Any Ideas how to overcome this limitation?
>
>Regards,
>Marcelo.
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Application Scope Variables

2002-02-05 Thread Robert Taylor

The "application object" is the ServletContext which can be accessed via the
ServletConfig or HttpSession.
For example:

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

Object attribute =
request.getSession().getServletContext().getAttribute("attribute_name");
}

or

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

Object attribute = this.getServlet().getServletConfig()
.getServletContext().getAttribute("attribute_name");
}


HTH,

robert
> -Original Message-
> From: SIVA,SEBASTIEN (HP-PaloAlto,ex1) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 8:31 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Application Scope Variables
>
>
> >Try application.getAttribute () to get the
> application
> >scope variable.
>
> How do I get this "application" object inside a perform method?
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 5:14 PM
> To: Struts Users Mailing List
> Subject: Re: Application Scope Variables
>
>
>
> Try application.getAttribute () to get the application
> scope variable.
>
>
>
>
>
> "SIVA,SEBASTI
>
> EN   To:
> "'[EMAIL PROTECTED]'"
> (HP-PaloAlto,<[EMAIL PROTECTED]>
>
> ex1)"cc:
>
>  Variables
> [EMAIL PROTECTED]>
>
>
>
> 02/05/02
>
> 05:17 PM
>
> Please
>
> respond to
>
> "Struts Users
>
> Mailing List"
>
>
>
>
>
>
>
>
>
> How do I use application scope variables in an Action subclass?
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Application Scope Variables

2002-02-05 Thread Antony Stace

On Tue, 5 Feb 2002 17:30:40 -0800 
"SIVA,SEBASTIEN (HP-PaloAlto,ex1)" <[EMAIL PROTECTED]> wrote:

> >Try application.getAttribute () to get the application
> >scope variable.
> 
> How do I get this "application" object inside a perform method?

In an ActionServlet you can use

   ServletContext servletContext = servlet.getServletContext();

BeanTypeYouWant tmpBeanYouWant =
(BeanTypeYouWant)servletContext.getAttribute(BEANNAMEYOUWANT);


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Opening one struts app from another without sharing sessions

2002-02-05 Thread Danny Collins

Hello everyone,
I was wondering if anyone had any idea how to open one
struts application from another struts application without sharing a
single session?
 
In my main app, we have the need to launch a small separate
application, that is also struts based, but all I can seem to find to
use is window.open and  in IE that ends up sharing session data, which
is highly undesirable. 
 
Any ideas,
 
TIA
Danny



RE: Application Scope Variables

2002-02-05 Thread SIVA,SEBASTIEN (HP-PaloAlto,ex1)

>Try application.getAttribute () to get the application
>scope variable.

How do I get this "application" object inside a perform method?


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 5:14 PM
To: Struts Users Mailing List
Subject: Re: Application Scope Variables



Try application.getAttribute () to get the application
scope variable.



 

"SIVA,SEBASTI

EN   To:
"'[EMAIL PROTECTED]'"
(HP-PaloAlto,<[EMAIL PROTECTED]>

ex1)"cc:



 

02/05/02

05:17 PM

Please

respond to

"Struts Users

Mailing List"

 

 





How do I use application scope variables in an Action subclass?

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





--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Application Scope Variables

2002-02-05 Thread Nitish . Naharas


Try application.getAttribute () to get the application
scope variable.



   

"SIVA,SEBASTI  

EN   To: "'[EMAIL PROTECTED]'"

(HP-PaloAlto,<[EMAIL PROTECTED]>  

ex1)"cc:   

 

   

02/05/02   

05:17 PM   

Please 

respond to 

"Struts Users  

Mailing List"  

   

   





How do I use application scope variables in an Action subclass?

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





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Application Scope Variables

2002-02-05 Thread SIVA,SEBASTIEN (HP-PaloAlto,ex1)

How do I use application scope variables in an Action subclass?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Form Field Values

2002-02-05 Thread Satish Jeejula

Hello,

I have a form and corresponding action to it. When ever I submit the form
(with some errors), I get back the validation errors but I loose all the
information I enter into the form fields.

I have mirrored my form to the registration form in the struts-example. But
still it does not work.

Any help is appreciated.

Thanks,
Satish

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Boost Struts with XSLT and XML - JavaWorld.com

2002-02-05 Thread Jeff Schnitzer

> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> 
> I think we are all onboard with view agnosticism now.

Great!

> Though, the Struts config file will accomodate any URI, and does not
> prefer JSPs in anyway whatsoever.
> 
> Personally, I'm liking the model we're seeing in X2 and VelServlet,
> where other "helper" servlets are loaded to handle whatever
presentation
> devices someone might use.

Using a URI to invoke a servlet is great for simple documents like JSP
or Velocity pages, but it is far too limiting for more complicated
"views" like XSLT.  With a simple URI, how would you configure these
things on a view-by-view basis:

* Define multiple transformations to iteratively run.
* Pass xslt params to the transformation process.
* Run transforms against XML generated from JSP or other views.
* Define custom uri-resolvers.
* Specify the name of the root element.

I've found that it makes sense to distinguish JSP, Velocity, et al as a
separate stage from XSLT and DVSL.  The former are "view" types, the
latter are "transform" types; users should be able to arbitrarily apply
transforms to views, and there is a considerable amount of configuration
data needed to define a transform.  Furthermore, the framework's
interface to a transform is not necessarily text; it is often much more
efficient to be able to pass a DOM, SAX events, or other parsed data
directly into the transform.

Side node:  A really neat idea adapted from Turbine is the "document"
transform which simply takes the output from executing one document and
passes it as a String in the request attributes to a subsequent
document.  This addresses 90% of what the struts-template taglibs are
used for, but in a templating-language-independent way and with far less
mess.

I'm trying to make a case for allowing much more configuration to be
specified in the Struts config file.  Taking all the above points, the
Maverick config for a command might look like this:


  

  
  
  


  

  
  

  
  

  

  
  
  

  

  


That should be pretty clear, although it's a lot more complicated than
most commands would be.  I don't think there is any way to do this sort
of thing in the current Struts config schema.  Do you think it's
reasonable to try to evolve some of the Struts schema in this direction?

> I think what we are moving towards is exposing the Struts controller
API
> as a standard object in the request that will be easy to use with any
> helper servlet or presentation system, including JSTL when it ships.

Will it allow arbitrary XML configuration data to be pulled from the
config file?

> Does this jive with where Maverick is going?

Well, in Maverick 2.0 we removed Velocity from the core and are using
the same JSP-like servlet that Struts is using, so I guess the answer is
"sort-of" :-)

> The ActionMapping object is pluggable. Would extending that provide
the
> support you need in the config to assist with the transformations?

I'm looking through the docs and javadocs, and I'm not sure.  How do you
plug it?  And is it free to interpret the XML?  Can it read
(hypothetically) child elements of  (under )?

Jeff Schnitzer
[EMAIL PROTECTED]
http://mav.sourceforge.net

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Tiles Definitions - how to I 18n them?

2002-02-05 Thread Matt Raible

Hopefully this is easy...

In the following tiles definition:

  
  
  
  
  
  
  

How do I make the "title" attribute come from my ApplicationResource.properties
file?

Thanks - first time getting into the nitty gritty of tiles, so sorry for the
ignorance.

Matt


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Trouble having a jsp scriplet in the value attribute of html:link tag

2002-02-05 Thread Aamir Saalam

Subhadra,

  <%
String linkIdStr = "123";

Map map = new Hashtable();
map.put("formAction", "edit");
map.put("linkId", linkIdStr);

pageContext.setAttribute("ExampleMapBean", map, PageContext.PAGE_SCOPE);
  %>
  
  xyz_1


After going through the documentation at 
  http://jakarta.apache.org/struts/struts-html.html#link

I tried the above modification, and it works.


--aamir

-Original Message-
From: Subhadra Vemuri [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 3:29 PM
To: Struts Users Mailing List (E-mail)
Subject: Trouble having a jsp scriplet in the value attribute of
html:link tag


Could someone please help me with the following?

I have the following struts html tag in my jsp file:


The jsp expression does not evaluate but goes to the editLink.do uri as
is.

However, if I make a minor change to the above stmt so it looks as follows,
the expression evaluates ok:


Would appreciate any help on this.

Thanks,
Subhadra


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Implementing HTTPS in Struts

2002-02-05 Thread Max Cooper

Rob,

You are absolutely correct that that is an issue. Our proposed solution for
it is to modify (or extend until this functionality is integrated into
Struts) the Struts form tag as you suggest, so that it will compute the
right URL, which may be an absolute https URL if the target action is
secure.

The primary mechanism for doing the HTTP/HTTPS switching is the extended
tags that compute the proper URL. The redirecting stuff is secondary and
only there in the case that someone makes an errant request (by typing the
URL, bad bookmark, etc.).

-Max

- Original Message -
From: "Robert Scaduto" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:22 PM
Subject: RE: Implementing HTTPS in Struts


> Steve,
>
> Thank you for your response.  I have taken a look at your https framework
> and I it looks great. I do have one concern though.
>
> In looking through the code I noticed that if a non-secure request comes
in
> to a action marked as secure, the framework will persist the request
> attributes in the session and tell the browser to re-direct using https.
> However this allows the parameters in the form or querystring to go across
> the network un-encrypted before the framework can perform the redirect.
>
> My thought was that the same SecureRequestUtils.computeURL() function
should
> also be used by the form tag to determine, before the form is rendered,
that
> the post should be transmitted via https.  This would require subclassing
> the struts FormTag as well.
>
> Am I totally off base here?
>
> -Rob
>
> -Original Message-
> From: Ditlinger, Steve [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 01, 2002 7:30 PM
> To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Implementing HTTPS in Struts
>
>
>
> Robert:
>
> We recently posted just such a solution.  Check it out at
> http://struts.ditlinger.com.  There you will find a description of our
> solution and a link to download our Struts extensions and example app.  If
> you have any questions, please do not hesitate to ask.
>
> Steve
>
>
> >You wrote:
> ---
> Hello all, my name is Rob Scaduto and I have just recently joined the
Struts
> user mailing list. I have yet to find any resources talking about how to
> handle switching between http and https (and vice versa) using struts. The
> only solution I was able to come up with was sub classing the Struts
LinkTag
> and adding a secure attribute. This would then dynamically build an
absolute
> path based on the jsp. This works great when you use the forward or page
> attribute, but doesn't work at all if you use the href attribute. I'd like
> to have a solution that works in all cases and I was curious if someone
> could add some insight. Thanks in advance, Rob
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Malani, Prakash

Hi,

How are you doing?  Take a look at the following:
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html?  It
will explain how to use templates in general and tiles in particular

Sincerely,
-Prakash

-
eBuilt, Inc. - Builders of Industrial-Strength e-Business
(http://www.eBuilt.com)
Learn Java! (http://www.cact.csupomona.edu/javacert.html)
Learn Design Patterns! (http://www.cact.csupomona.edu/UML_Specialist.htm)
Want answers to Java, OOAD, UML, Design Patterns, EJBs, JSPs, Servlets, XP,
etc? (http://clubs.yahoo.com/clubs/bartssandbox)

> could u please explain me how to use templates...
> 
> Thanks in advance
> Kalpana
> 
> On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> > If you want to include the file as a footer consider 
> > using the template
> > taglibs.  
> > 
> > Include can be used anywhere not just at the top but 
> > for your problem using
> > templates would be a better idea.
> > 
> > 
> > -Original Message-
> > From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> > m]
> > Sent: Tuesday, February 05, 2002 12:01 PM
> > To: Struts Users Mailing List
> > Subject: RE: Jsp in another Jsp using struts
> > 
> > 
> > 
> > I want to add a jsp page as a footer/bottom to every 
> > other Jsp pages 
> > 
> > but <%@ include file="xxx.jsp" %> is used at the top i 
> > guess???
> > 
> > Thanks in advance
> > Kalpana
> > 
> > On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> > > You dont need struts for this. Just use
> > > 
> > > <%@ include file="xxx.jsp" %> wherever you want to 
> > > insert your JSP file.
> > > 
> > > 
> > > -Original Message-
> > > From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> > co-
> > > m]
> > > Sent: Tuesday, February 05, 2002 11:54 AM
> > > To: Struts Users Mailing List
> > > Subject: Jsp in another Jsp using struts
> > > 
> > > 
> > > 
> > > Hi
> > > 
> > > Can anyone tell me how can i include a jsp page into 
> > > another jsp using
> > > struts???
> > > 
> > > thanks in advance
> > > Kalpana 
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:
> > > 
> > > For additional commands, e-mail:
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:    > ib-
> > > [EMAIL PROTECTED]>
> > > For additional commands, e-mail: 
> > > 
> > > 
> >  
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> > 
> > --
> > To unsubscribe, e-mail:    > [EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > 
> > 
>  
> 
> 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Beginner questions

2002-02-05 Thread Ted Husted

Just instantiate the bean, place it the request under a known name, and
then use that same name on the other side. 

 ResultBean result = new ResultBean();

// ...

 request.setAttribute("RESULT",result);


mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 20, 2002 8:47 AM
> To: Struts Users Mailing List
> Subject: Re: Beginner questions
> 
> The Struts bean tags do not require the useBean read tape, and it is
> rare for a Struts application to ever need to do this :)
> 
> Struts is designed to encourage architectures based on the MVC paradigm.
> Generally, we recommend that all the beans be created and properties set
> by an Action object (org.apache.struts.Action) before forwarding control
> the presentation page. The page should just be outputing data, and
> shouldn't to do any additional processing. That's the Action's job :)
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Building Java web applications with Struts.
> -- Tel +1 585 737-3463.
> -- Web http://www.husted.com/struts/
> 
> Ronan-Yann LORIN wrote:
> >
> > Hi all,
> >
> > Excuse me if those questions looks stupid, I've seeked the documentation
> but
> > couldn't find the answer.
> >
> > 1) How do I write the following lines with struts:
> > 
> > 
> > I tried to create the bean the following way without success:
> > 
> > and how to set all it's properties from parameters?
> >
> > 2) How do I set a bean's property from an other bean property? (something
> > like "logonForm.username = argv.utilisateur")
> >
> > Thanks in advance for your help
> > Ronan-Yann Lorin
> > Banque AGF
> > Direction des Opérations, Service Informatique
> > tél : 01 44 86 27 99
> > fax : 0 811 013 002
> > mél : [EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




JSP and Tag Libraries for Web Development book

2002-02-05 Thread Henderson, Jerald


Has anyone tried to use the Struts examples from the book, JSP and Tag
Libraries for Web Development ?

I can't any of examples to work from the book and the Code/File Downloads 
from the http://www.newriders.com/ isn't much better. I had to make several
changes to even get past the index (menu) page.

If any one has been able to get the Struts example to work, please let me
know

Thanks. 

Jerald L. Henderson
Sprint PCS --  Sales & Distribution
Office 913.534.6188
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Beginner questions

2002-02-05 Thread Michael Hedgpeth

Could someone you give me a simple example of a bean being declared in the
Action class that IS NOT an ActionForm and then accessed in the JSP
 tag?  The ActionForm maintenance seems to be pretty
straight-forward, but I'm dealing with plenty of objects that don't directly
relate to forms (such as summary data) that I would like to pull up in the
Action class and set so the  can access it (in a report
format).

Thanks,
Michael Hedgpeth

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 8:47 AM
To: Struts Users Mailing List
Subject: Re: Beginner questions


The Struts bean tags do not require the useBean read tape, and it is
rare for a Struts application to ever need to do this :) 

Struts is designed to encourage architectures based on the MVC paradigm.
Generally, we recommend that all the beans be created and properties set
by an Action object (org.apache.struts.Action) before forwarding control
the presentation page. The page should just be outputing data, and
shouldn't to do any additional processing. That's the Action's job :)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Ronan-Yann LORIN wrote:
> 
> Hi all,
> 
> Excuse me if those questions looks stupid, I've seeked the documentation
but
> couldn't find the answer.
> 
> 1) How do I write the following lines with struts:
> 
> 
> I tried to create the bean the following way without success:
> 
> and how to set all it's properties from parameters?
> 
> 2) How do I set a bean's property from an other bean property? (something
> like "logonForm.username = argv.utilisateur")
> 
> Thanks in advance for your help
> Ronan-Yann Lorin
> Banque AGF
> Direction des Opérations, Service Informatique
> tél : 01 44 86 27 99
> fax : 0 811 013 002
> mél : [EMAIL PROTECTED]

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Service Locator pattern with Poolman & Struts

2002-02-05 Thread Matt Raible

Is it a good idea to use a Service Locator Pattern with Poolman?  I have the
following class:

public class ServiceLocator {

/** singleton's private instance */
private static ServiceLocator me;

static {
me = new ServiceLocator();
}

private ServiceLocator() {}

/** returns the Service Locator instance */
static public ServiceLocator getInstance() {
return me;
}

private DataSource ds = null;
private Connection con = null;

/** Retrieves a connection from the connection pool */
public Connection getConnection() {
try {
ds = PoolMan.getDataSource();
con = ds.getConnection();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
}
return con;
}

/** Returns a connection from the connection pool */
public void closeConnection(Connection con) {
JDBCPool.closeConnection(con);
}
}

So in my Struts Action classes, I can simply get and close connections with
the following code:

ServiceLocator serviceLocator = ServiceLocator.getInstance();

  con = serviceLocator.getConnection();
serviceLocator.closeConnection(con);

Any thoughts are appreciated.

Matt


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




MessageResources - Design question - loading resources from a DB by creating you own PropertyMessageResourcesFactory

2002-02-05 Thread Todd G. Nist

Hello,

First, I would like to apologize for the size of this post.  I seem to be
missing one thing here and can't seem to put my finger on it.

We have a database which contains most of the translations for our
applications messages and database fields/column labels.  There is one table
which contains the messages, ApplicationResources, and another table called
field which contains general information about a field/column in the
database.  The field table is really only there to provide basic metadata
about columns like, the Column/Field label and some other basic information
which certain DB's do not provide.

There is one other table, Translations, which is made up of 3 columns
locale, stringID and transValue.

ApplicationResourcesTranslationsField
-   
---
| key (pu) varchar || transValuevarchar |   | fieldID (pu) int 
|   |
| message  varchar |-<| stringID (pu) varchar |>| fieldLabel
(pu) varchar |
| locale (pu)   varchar |   | fieldName (pu) 
varchar  |
-   
---

I would like to load this information via my on
PropertyMessageResourcesFactory.  I have modified the web.xml to set the
parameter "factory" and set the  to my factory class,
DBMessageResourcesFactory.  The factory is called and my class,
BasePropertyMessageResources, is called and it appears as though all is
loaded in correctly based on the output being displayed below.  However,
whenever I use the  tag, it throws the
following exception:

[ServletException in:company/CompanyZoomBody.jsp] Missing message for key
MLSBuyer.title' javax.servlet.jsp.JspException: Missing message for key
MLSBuyer.title at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:298) at
org.apache.jsp.CompanyZoomBody$jsp._jspService(CompanyZoomBody$jsp.java:84)
at 

Debugging messages displayed during execution:

===
Config: ApplicationResources
===
Completed BasePropertyMessageResources
Get MessageResources for key: org.apache.struts.action.MESSAGE
loading the following key: US.MLSBuyer.title with value MLSBuyer
loading the following key: US.button.cancel with value Cancel
loading the following key: US.button.save with value Save
loading the following key: US.button.update with value Update
loading the following key: FR.MLSBuyer.title with value MLSBuyer - French
loading the following key: FR.button.cancel with value FR Cancel
loading the following key: FR.button.save with value FR Save
loading the following key: FR.button.update with value FR Update
loading the following key: FR.MLSBuyer.title with value MLSBuyer - French
loading the following key: FR.button.cancel with value FR Cancel
loading the following key: FR.button.save with value FR Save
loading the following key: FR.button.update with value FR Update
loading the following key: US.CompanyName with value Company Name
loading the following key: FR.CompanyName with value French Company Name
loading the following key: FR.CompanyName with value French Company Name
===
/* Closing Translation Connection
===
===
/* Iterate over messages
===
US.button.cancelCancel
US.CompanyName  Company Name
US.button.save  Save
FR.button.updateFR Update
US.button.updateUpdate
FR.CompanyName  French Company Name
US.MLSBuyer.title   MLSBuyer
FR.button.cancelFR Cancel
FR.MLSBuyer.title   MLSBuyer - French
FR.button.save  FR Save

I have extend the ActionServlet class and added the following
"initApplication()" method, this much seems to work fine.

public void initApplication() throws ServletException {
super.initApplication();

String dataSource =
getServletConfig().getInitParameter("datasource");

if (dataSource != null && !dataSource.equals("")) {
getServletContext().setAttribute("DATASOURCE", dataSource);
}

System.out.println("Get MessageResources for key: " +
Action.MESSAGES_KEY);
MessageResources mr =
(MessageResources)getServletContext().getAttribute(Action.MESSAGES_KEY);

if (mr == null) {
System.out.println("Message Resource is invalid");
return;
}
  // load resources from the dataSource
((BasePropertyMessageResources)mr).dbLoad(dataSource);

}

The MessageResources classs, BasePropertyMessageResources, is as follows and
seems to build messages just fine:

public class BasePropertyMessageResources extends PropertyMessageResources {

private static final Category log =
Category.getInstance("BaseProperyMessageResources");

private static final String[

Trouble having a jsp scriplet in the value attribute of html:link tag

2002-02-05 Thread Subhadra Vemuri

Could someone please help me with the following?

I have the following struts html tag in my jsp file:


The jsp expression does not evaluate but goes to the editLink.do uri as
is.

However, if I make a minor change to the above stmt so it looks as follows,
the expression evaluates ok:


Would appreciate any help on this.

Thanks,
Subhadra


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Boost Struts with XSLT and XML - JavaWorld.com

2002-02-05 Thread Ted Husted

Jeff Schnitzer wrote:
> I'm not just writing this to publicize a competing framework
> (http://mav.sourceforge.net :-).  I am beginning to wonder if maybe
> there is some potential to merge it with the Struts codebase.  It sounds
> like Struts is being decoupled from JSP and generally moving in the
> direction of a view-agnostic MVC framework.  If a year ago I had
> suggested making changes to the Struts config file format to accommodate
> XSL, I think I would have been booed, but I'm not so sure anymore.  Any
> thoughts?

I think we are all onboard with view agnosticism now. 

Though, the Struts config file will accomodate any URI, and does not
prefer JSPs in anyway whatsoever. 

Personally, I'm liking the model we're seeing in X2 and VelServlet,
where other "helper" servlets are loaded to handle whatever presentation
devices someone might use. 

I think what we are moving towards is exposing the Struts controller API
as a standard object in the request that will be easy to use with any
helper servlet or presentation system, including JSTL when it ships. 

Does this jive with where Maverick is going?

The ActionMapping object is pluggable. Would extending that provide the
support you need in the config to assist with the transformations?



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Boost Struts with XSLT and XML - JavaWorld.com

2002-02-05 Thread Jeff Schnitzer

IMHO, internationalization is best done on the tail-end rather than up
front.  This is a little bit backwards compared to how you're probably
used to doing it.

My approach would be to scatter xml elements like 
throughout your base XML and XSLT transforms, making sure that they pass
unmolested to the last transform.  The last transform would be a simple
stylesheet that included the identity transform and a bunch of templates
that look like this:

The Foo Message
The Bar Message

Assuming you have a framework that allows multiple XSLT transforms to be
chained together using SAX events, this should actually be quite
efficient.

About a year ago a friend and I wanted an MVC framework that allowed us
to work with XSL.  Struts was very tightly coupled to JSP at the time
(and arguably still is), so we wrote our own.  It is very similar to
Struts in many ways, but it is designed around building what the
JavaWorld article calls "Model 2X".  Like Struts, Maverick (our
framework) offers an XML sitemap configuration, but unlike Struts:

* Each view can have multiple, iterative transformations
* You can halt the transformation process at any step and obtain static
XML that designers can work with offline.
* JavaBeans are automatically "domified" with an adapter that uses Java
reflection to provide a lazily-loaded DOM façade.  No need to ever
generate or parse text XML.
* Designed from the start to be template-language agnostic; you can
seamlessly mix and match XSLT, JSP, Velocity, or other views.
* View and transform types are pluggable.  Not only can you use XSLT
transforms, but also DVSL transforms and "document" transforms that let
you use JSP or Velocity to simply wrap the content of previous steps.
* Framework will automatically pick from multiple views based on
Accept-Language or any other request characteristic, automating
internationalization, browser customization, etc.
* Actions (called Controllers in Maverick) can work either like Struts
Actions (which are singletons) or like WebWork Actions (which are
instantiated, used, and thrown away on every request).

I'm not just writing this to publicize a competing framework
(http://mav.sourceforge.net :-).  I am beginning to wonder if maybe
there is some potential to merge it with the Struts codebase.  It sounds
like Struts is being decoupled from JSP and generally moving in the
direction of a view-agnostic MVC framework.  If a year ago I had
suggested making changes to the Struts config file format to accommodate
XSL, I think I would have been booed, but I'm not so sure anymore.  Any
thoughts?

Anyone familiar with the Struts config file would probably be amused by
seeing the Maverick equivalent.

Here is what a Maverick config file looks like for an XSL app (a simple
contact-list manager):

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/opt-domify/examples/f
riendbook-domify/WEB-INF/maverick.xml?rev=1.4&content-type=text/vnd.view
cvs-markup

Here is the exact same app (uses the same Controller aka Action classes)
using JSP (with the JSTL ea3 taglib):

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/maverick/examples/fri
endbook-jsp/WEB-INF/maverick.xml?rev=1.5&content-type=text/vnd.viewcvs-m
arkup

Here is the exact same app using Velocity:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/opt-velocity/examples
/friendbook-velocity/WEB-INF/maverick.xml?rev=1.2&content-type=text/vnd.
viewcvs-markup

And here is a simple config file which shows using the
internationalization feature:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/maverick/examples/shu
nting-jsp/WEB-INF/maverick.xml?rev=1.3&content-type=text/vnd.viewcvs-mar
kup

Perhaps there merging the two projects is worth investigating?

Jeff Schnitzer
[EMAIL PROTECTED]
Maverick:  http://mav.sourceforge.net

>-Original Message-
>From: Chappell, Simon P
>
>1. I18N. Agreed. This is a problem. Having gotten used to I18N 
>in my apps, I really have no desire to give it up. According 
>to the book XSLT (by Doug Tidwell, Pub: O'Reilly, Aug 2001) it 
>is possible to extend XSL/XSLT with Java extensions. Could we 
>brave souls not write an XSL/XSLT extension to give us the 
>I18N that we get in struts-powered JSPs? On the other hand, as 
>I re-read this before I hit send, the XSL/XSLT only process 
>the XML that it's given. It's up to what ever generates the 
>XML to perform the I18N. With a struts/XSL/XSLT mix, who's 
>responsibility would it be to provide I18N?


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Implementing HTTPS in Struts

2002-02-05 Thread Robert Scaduto

Steve,

Thank you for your response.  I have taken a look at your https framework
and I it looks great. I do have one concern though.

In looking through the code I noticed that if a non-secure request comes in
to a action marked as secure, the framework will persist the request
attributes in the session and tell the browser to re-direct using https.
However this allows the parameters in the form or querystring to go across
the network un-encrypted before the framework can perform the redirect.

My thought was that the same SecureRequestUtils.computeURL() function should
also be used by the form tag to determine, before the form is rendered, that
the post should be transmitted via https.  This would require subclassing
the struts FormTag as well.

Am I totally off base here?

-Rob

-Original Message-
From: Ditlinger, Steve [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 7:30 PM
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: Re: Implementing HTTPS in Struts



Robert:

We recently posted just such a solution.  Check it out at
http://struts.ditlinger.com.  There you will find a description of our
solution and a link to download our Struts extensions and example app.  If
you have any questions, please do not hesitate to ask.

Steve


>You wrote:
---
Hello all, my name is Rob Scaduto and I have just recently joined the Struts
user mailing list. I have yet to find any resources talking about how to
handle switching between http and https (and vice versa) using struts. The
only solution I was able to come up with was sub classing the Struts LinkTag
and adding a secure attribute. This would then dynamically build an absolute
path based on the jsp. This works great when you use the forward or page
attribute, but doesn't work at all if you use the href attribute. I'd like
to have a solution that works in all cases and I was curious if someone
could add some insight. Thanks in advance, Rob


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread Ted Husted

The best practice now is to use ActionMappings for everything, so that
the reqeust passes through the controller. 

This buys you several important capabilities that become important as
applications grow. Not the least of which is the new support for
multiple applications in the Nightly Build. 

The ActionMapping has a validate property that you can use to turn off
validation when the mapping is used to initialize a new form. So,
typically, you will have an ActionMapping for each circumstance. 


name="itemForm"
scope="request"
validate="false">


   
 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Sid Stuart wrote:
> 
> Hi,
> 
> I've stumbled across a subtle problem/design question that I don't see
> mentioned in the documentation.
> 
> The ActionForm's validate method can be configured to verify form data
> from a page and generate error messages which may then be displayed on
> the page for the user to see. This works fine when the user has accessed
> the page by specifying a JSP file in the URL. When the user accesses the
> page by calling the Action directly though, the validate method is
> called before the user ever sees the page, much less inputs valid data
> to the form. This leads to an unfortunate display of unwarranted error
> messages.
> 
> It would be nice if the documentation would provide a rule such as:
> If one plans on the user calling the Action directly in the URL  then
> one should not use the automatic validation provided by ActionForm.
> 
> Further, as having two different procedures to generate a page can lead
> to subtle errors, one should decide whether a page will be accessed as a
> JSP or as an Action and design for the one scenario. The simplest (and
> safest) design rule will be to access all pages through either one
> mechanism or the other.
> 
> Comments?
> 
> Sid Stuart

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How can I get Struts to re-read the config file?

2002-02-05 Thread Press, Michael


Figured it out - needed to tell the Action Servlet to explicitly defeat
caching.  In web.xml:


action

org.apache.struts.action.ActionServlet

no-cache
true



Now page flow changes dynamically as in the scenario below.

Thanks!
Michael

-Original Message-
From: Press, Michael [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 3:27 PM
To: 'Struts Users Mailing List'
Subject: RE: How can I get Struts to re-read the config file?



Thanks for the info, but this doesn't seem to have the effect I want - to be
able to change the page flow, have Struts reload the config file, and have
the new flow take immediate effect.

For example, I have this action running:



Then I make this change to struts-config.xml:


   
Then I call the /admin/reload action (it returns "OK").  When I invoke the
/home action, I still go to home.jsp, not home2.jsp as I'd expect.
(Bouncing Tomcat causes me to then go to home2.jsp).

Other suggestions?

Thanks,
Michael



-Original Message-
From: Robert Scaduto [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 3:05 PM
To: Struts Users Mailing List
Subject: RE: How can I get Struts to re-read the config file?


Struts includes a ReloadAction that will reload the struts-config.xml and
the ApplicationResources.

Just include...



in your struts config.   To re-load, navigate your browser to
/admin/reload.do

That should do it.

-Rob


-Original Message-
From: Press, Michael [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:33 PM
To: '[EMAIL PROTECTED]'
Subject: How can I get Struts to re-read the config file?


I would like for my webapp to be able to re-read struts-config.xml without
having to bounce the servlet container (Tomcat 4.0.1) or bounce/reload my
webapp.  Is this possible?

Thanks,
Michael

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question about ActionForm's validate method

2002-02-05 Thread Greg Hess

Unfortunatly not all html input fields are populated in the http request by
default. Radio Buttons and Check boxes will be null if the user did not
select the option.

-Original Message-
From: Sid Stuart [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:56 PM
To: Struts Users Mailing List
Subject: Re: Design question about ActionForm's validate method


You get a zero length string.

Sid

dderry wrote:

> What if your user then hits the Submit button without populating any of
the
> form fields?
>
> - Original Message -
> From: "Sid Stuart" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 2:06 PM
> Subject: Re: Design question about ActionForm's validate method
>
> > Hi,
> >
> > My friend, Lee Crawford, just pointed out to me that the fields of the
> > ActionForm will be null if the validate method is called before the form
> is
> > submitted, but will be non-null afterwards. This provides a quick and
> simple
> > test that works for JSP called pages and for Action called pages,
> >
> >
> >public ActionErrors validate (ActionMapping mapping,
> >  HttpServletRequest request) {
> >  // See if the form has been submitted, if not do not
> >  validate.
> >  if (logon == null || password == null ) return null;
> >  // Validate the data
> >  final ActionErrors errors = new ActionErrors ();
> >  if (logon.length() < 1) {
> >  errors.add ("logon", new ActionError
> >  ("error.logon.logonRequired"));
> >  }
> >  if (password.length() < 1) {
> >  errors.add("password", new ActionError
> >  ("error.logon.passwordRequired"));
> >  }
> >  return errors;
> >  }
> >
> >
> > Sid
> >
> >
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How can I get Struts to re-read the config file?

2002-02-05 Thread Press, Michael


Thanks for the info, but this doesn't seem to have the effect I want - to be
able to change the page flow, have Struts reload the config file, and have
the new flow take immediate effect.

For example, I have this action running:



Then I make this change to struts-config.xml:


   
Then I call the /admin/reload action (it returns "OK").  When I invoke the
/home action, I still go to home.jsp, not home2.jsp as I'd expect.
(Bouncing Tomcat causes me to then go to home2.jsp).

Other suggestions?

Thanks,
Michael



-Original Message-
From: Robert Scaduto [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 3:05 PM
To: Struts Users Mailing List
Subject: RE: How can I get Struts to re-read the config file?


Struts includes a ReloadAction that will reload the struts-config.xml and
the ApplicationResources.

Just include...



in your struts config.   To re-load, navigate your browser to
/admin/reload.do

That should do it.

-Rob


-Original Message-
From: Press, Michael [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:33 PM
To: '[EMAIL PROTECTED]'
Subject: How can I get Struts to re-read the config file?


I would like for my webapp to be able to re-read struts-config.xml without
having to bounce the servlet container (Tomcat 4.0.1) or bounce/reload my
webapp.  Is this possible?

Thanks,
Michael

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread dderry

True, so I guess the null test will work.


- Original Message -
From: "Sid Stuart" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:55 PM
Subject: Re: Design question about ActionForm's validate method


> You get a zero length string.
>
> Sid
>
> dderry wrote:
>
> > What if your user then hits the Submit button without populating any of
the
> > form fields?
> >
> > - Original Message -
> > From: "Sid Stuart" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 05, 2002 2:06 PM
> > Subject: Re: Design question about ActionForm's validate method
> >
> > > Hi,
> > >
> > > My friend, Lee Crawford, just pointed out to me that the fields of the
> > > ActionForm will be null if the validate method is called before the
form
> > is
> > > submitted, but will be non-null afterwards. This provides a quick and
> > simple
> > > test that works for JSP called pages and for Action called pages,
> > >
> > >
> > >public ActionErrors validate (ActionMapping mapping,
> > >  HttpServletRequest request) {
> > >  // See if the form has been submitted, if not do not
> > >  validate.
> > >  if (logon == null || password == null ) return null;
> > >  // Validate the data
> > >  final ActionErrors errors = new ActionErrors ();
> > >  if (logon.length() < 1) {
> > >  errors.add ("logon", new ActionError
> > >  ("error.logon.logonRequired"));
> > >  }
> > >  if (password.length() < 1) {
> > >  errors.add("password", new ActionError
> > >  ("error.logon.passwordRequired"));
> > >  }
> > >  return errors;
> > >  }
> > >
> > >
> > > Sid
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




localhost:8100/admin/listDepartment.do --> 0.0.0.0:8100/admin/listDepartment.do

2002-02-05 Thread Cheng, Sophia

Hi, 

When I try to refresh a page, data are all populated from the form
correctly, but all of my links on that page sometimes turn out to be
0.0.0.0:8100/admin/. while they are supposed to be
localhost:8100/admin/ 
The output of  becomes http://0.0.0.0:8100/admin/basicLayout.jsp";>

If I refresh that page again, it displays correctly.  It just
continuously takes turns to behave right and wrong when I refresh the page
again and again.

This wired situation does not happen always, but it happens once a
while.
Any idea?
By the way, I am running struts and tiles in JRun3.1

Regards, 
Sophia

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How can I get Struts to re-read the config file?

2002-02-05 Thread Robert Scaduto

Struts includes a ReloadAction that will reload the struts-config.xml and
the ApplicationResources.

Just include...



in your struts config.   To re-load, navigate your browser to
/admin/reload.do

That should do it.

-Rob


-Original Message-
From: Press, Michael [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:33 PM
To: '[EMAIL PROTECTED]'
Subject: How can I get Struts to re-read the config file?


I would like for my webapp to be able to re-read struts-config.xml without
having to bounce the servlet container (Tomcat 4.0.1) or bounce/reload my
webapp.  Is this possible?

Thanks,
Michael

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread Sid Stuart

You get a zero length string.

Sid

dderry wrote:

> What if your user then hits the Submit button without populating any of the
> form fields?
>
> - Original Message -
> From: "Sid Stuart" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 2:06 PM
> Subject: Re: Design question about ActionForm's validate method
>
> > Hi,
> >
> > My friend, Lee Crawford, just pointed out to me that the fields of the
> > ActionForm will be null if the validate method is called before the form
> is
> > submitted, but will be non-null afterwards. This provides a quick and
> simple
> > test that works for JSP called pages and for Action called pages,
> >
> >
> >public ActionErrors validate (ActionMapping mapping,
> >  HttpServletRequest request) {
> >  // See if the form has been submitted, if not do not
> >  validate.
> >  if (logon == null || password == null ) return null;
> >  // Validate the data
> >  final ActionErrors errors = new ActionErrors ();
> >  if (logon.length() < 1) {
> >  errors.add ("logon", new ActionError
> >  ("error.logon.logonRequired"));
> >  }
> >  if (password.length() < 1) {
> >  errors.add("password", new ActionError
> >  ("error.logon.passwordRequired"));
> >  }
> >  return errors;
> >  }
> >
> >
> > Sid
> >
> >
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread dderry

What if your user then hits the Submit button without populating any of the
form fields?


- Original Message -
From: "Sid Stuart" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:06 PM
Subject: Re: Design question about ActionForm's validate method


> Hi,
>
> My friend, Lee Crawford, just pointed out to me that the fields of the
> ActionForm will be null if the validate method is called before the form
is
> submitted, but will be non-null afterwards. This provides a quick and
simple
> test that works for JSP called pages and for Action called pages,
>
>
>public ActionErrors validate (ActionMapping mapping,
>  HttpServletRequest request) {
>  // See if the form has been submitted, if not do not
>  validate.
>  if (logon == null || password == null ) return null;
>  // Validate the data
>  final ActionErrors errors = new ActionErrors ();
>  if (logon.length() < 1) {
>  errors.add ("logon", new ActionError
>  ("error.logon.logonRequired"));
>  }
>  if (password.length() < 1) {
>  errors.add("password", new ActionError
>  ("error.logon.passwordRequired"));
>  }
>  return errors;
>  }
>
>
> Sid
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How can I get Struts to re-read the config file?

2002-02-05 Thread Press, Michael

I would like for my webapp to be able to re-read struts-config.xml without
having to bounce the servlet container (Tomcat 4.0.1) or bounce/reload my
webapp.  Is this possible?
 
Thanks,
Michael

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Best pratice for using Log4j, EJB, Struts, and WebLogic 6.1 together

2002-02-05 Thread Adam


You may want to think about the configuration thing.  You web app and 
your EJBs should be separate, as should your logging.

Another option is to proxy Log4J to the EJB layer, but that is more work 
than you want to do.

You can copy the same log file twice as part of your build script, which 
would seem to be the easest answer.  If they are almost-but-not-quite 
identical, use the ant filter tag while copying.

Singletons in the web application should really be application scope 
Beans.  They should be stateless to teh same degree as Servlet is 
stateless.  If this is not an option, consider flyweight instead (usally 
a better way of doing business than singleton).  In the EJB Layer, A 
singleton probably should be a stateless session bean that does not 
participate in the transaction. My guess is that you should mark it's 
transaction attribute as Supports, but you may want to look into this 
more.  Basically, you don't want the Singleton causing deadlock.  Again, 
the Flyweight pattern is a better way of doing business.  Most EJB 
containers will keep the static classes deployed in the Jar separate 
from the static classes deployed in the war file, so you won't have a 
true singleton anyway, unless you do it at the container level (like the 
lib directory of the servlet container, at least in tomcat land).




Eric Ma wrote:

>Environment: WebLogic 6.1 SP1, Struts 1.0.1, and Log4j 1.1.3.  Application is 
>deployed as a single .ear file in a single WebLogic instance.  log4j.jar is in the 
>EJB classloader's classpath, not the WebLogic classpath nor the web app's classloader 
>classpath.
>
>Scenario:  I want to be able to use Log4j in JSP custom tag handlers, servlets 
>(Struts action classes to be exact) and EJB's.
>
>What I have done so far:  used a startup servlet to do Log4j configuration for 
>servlets logging.  The config file is under the web app's WEB/INF directory.  
>Separately, I used a factory class with static methods to configure Log4j for EJB 
>logging, and for this I have to use a replicate of the configuration file but outside 
>the .ear file.  I use a RFAppender for logging output.
>
>What I want to achieve: configure Log4j once for the WebLogic instance, not for EJB's 
>and servlets separately, and I want to put the configuration file in the .ear file, 
>not outside it.
>
>Other general questions: do you see any major problems with regard to threading, 
>singleton, and static classes in a EJB container environment?
>
>Any suggestion is greatly welcome.
>
>Eric Ma
>
>
>--
>
>This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread Sid Stuart

Hi,

My friend, Lee Crawford, just pointed out to me that the fields of the
ActionForm will be null if the validate method is called before the form is
submitted, but will be non-null afterwards. This provides a quick and simple
test that works for JSP called pages and for Action called pages,


   public ActionErrors validate (ActionMapping mapping,
 HttpServletRequest request) {
 // See if the form has been submitted, if not do not
 validate.
 if (logon == null || password == null ) return null;
 // Validate the data
 final ActionErrors errors = new ActionErrors ();
 if (logon.length() < 1) {
 errors.add ("logon", new ActionError
 ("error.logon.logonRequired"));
 }
 if (password.length() < 1) {
 errors.add("password", new ActionError
 ("error.logon.passwordRequired"));
 }
 return errors;
 }


Sid

Sid Stuart wrote:

> Hi,
>
> I've stumbled across a subtle problem/design question that I don't see
> mentioned in the documentation.
>
> The ActionForm's validate method can be configured to verify form data
> from a page and generate error messages which may then be displayed on
> the page for the user to see. This works fine when the user has accessed
> the page by specifying a JSP file in the URL. When the user accesses the
> page by calling the Action directly though, the validate method is
> called before the user ever sees the page, much less inputs valid data
> to the form. This leads to an unfortunate display of unwarranted error
> messages.
>
> It would be nice if the documentation would provide a rule such as:
> If one plans on the user calling the Action directly in the URL  then
> one should not use the automatic validation provided by ActionForm.
>
> Further, as having two different procedures to generate a page can lead
> to subtle errors, one should decide whether a page will be accessed as a
> JSP or as an Action and design for the one scenario. The simplest (and
> safest) design rule will be to access all pages through either one
> mechanism or the other.
>
> Comments?
>
> Sid Stuart



Best pratice for using Log4j, EJB, Struts, and WebLogic 6.1 together

2002-02-05 Thread Eric Ma

Environment: WebLogic 6.1 SP1, Struts 1.0.1, and Log4j 1.1.3.  Application is deployed 
as a single .ear file in a single WebLogic instance.  log4j.jar is in the EJB 
classloader's classpath, not the WebLogic classpath nor the web app's classloader 
classpath.

Scenario:  I want to be able to use Log4j in JSP custom tag handlers, servlets (Struts 
action classes to be exact) and EJB's.

What I have done so far:  used a startup servlet to do Log4j configuration for 
servlets logging.  The config file is under the web app's WEB/INF directory.  
Separately, I used a factory class with static methods to configure Log4j for EJB 
logging, and for this I have to use a replicate of the configuration file but outside 
the .ear file.  I use a RFAppender for logging output.

What I want to achieve: configure Log4j once for the WebLogic instance, not for EJB's 
and servlets separately, and I want to put the configuration file in the .ear file, 
not outside it.

Other general questions: do you see any major problems with regard to threading, 
singleton, and static classes in a EJB container environment?

Any suggestion is greatly welcome.

Eric Ma


--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Solved: ActionErrors within frames manually forwarded

2002-02-05 Thread holger.wiechert

Well, after an eternity, the problem found was
that the ApplicationResources property "errors.header" 
had a value with double quotes in it (like ).
That spoiled the src string in the frame page.

Have fun,
Holger



-Ursprüngliche Nachricht-
Von:[EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Gesendet am:Dienstag, 5. Februar 2002 12:37
An: [EMAIL PROTECTED]
Betreff:ActionErrors within frames manually forwarded

Hi,

I've spent some time checking the list for this issue,
but I could only find related topics, that didn't really help. 
In case that this has been answered before, please ignore it
and send me a link.

I think that there must be something I've missed
when using the Struts validation feature within frames.
In short: I'm trying to manually retrieve and "forward" the ActionErrors
within a frame definition page (which is the "input" page
for a mapping). But those manually set request parameters
are gone when I access them.

The situation is as follows:

The page myframe.jsp consists of two frames: 
mynavigation.jsp and myContent.jsp. 
myContent.jsp is the JSP that is validated. 
In case that a validation error (ActionError) occurs,
the follwoing (relevant) events occur (correct me if I'm wrong)
- Struts puts the ActionErrors I created within validate into the request
- a forward to the "input" page is done as defined in the struts-config (in
  my case the "action" entry is:

  
  


  so it leads to the frame page.
- within the myframe.jsp, two new requests are created: one for each frame

But I think I should still be able to access the request with the ActionErrors
within the frame definition page. So in myframe.jsp I could do something like:

myframe.jsp:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


   
  MyTitle


 
  
  " NAME="content">
  

 



in order to retrieve the ActionError String for property "myErrorProperty"
within the content page:

myContent.jsp:

...

 <%= request.getParameter("manuallySetParam") %> 




This - I agree - doesn't look elegant, but at least it should work.

If I have the input page defined as a pure jsp (no frames),
the html:errors are retrieved as expected.

Are there any ideas, why the parameter "manuallySetParam" does not
contain the error message of key "myErrorProperty" ?

Help and/or design suggestions greatly appreciated!

Thanks in advance,
Holger



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 
__
Die schönsten Ski-Regionen der Alpen - jetzt bei Ferienklick.de
http://ferienklick.de/ski/?PP=2-5-100-105-38


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [OT] Publishing an Application

2002-02-05 Thread Olivier Dinocourt

ant
- Original Message -
From: "Brad Rhoads" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 4:34 PM
Subject: [OT] Publishing an Application


>
> I'm looking for a good tool for publishing an application. It should
compare
> the source directory to the target and only move files that have changed.
> I'd also like an option to skip certain files, i.e. web.xml.
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Database Servlet

2002-02-05 Thread Robert Scaduto

You could keep a reference to the last modified date of the xml file when
you init the servlet and then check the timestamp every time your main page
runs.  If it changes the re-run the digester.

-or-

If you don't have access to the timestamp then, you could refresh at
periodic intervals on a different thread. And then replace the old java
beans in the ServletContext.

-or-

You can read the file every time if the page needs to be in sync at all
times. This is the most accurate solution but not the most efficient.

Hope this helps,

Rob

-Original Message-
From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 7:43 AM
To: Struts Users Mailing List
Subject: Database Servlet


Hello,

I apologize if my question sounds naive but I really need your help on this.
 I have a servlet that during initialization parses an .xml file using
Digester. Then I access the data in  my jsps through JavaBeans. What I need
to do, is to have my main page which displays the data from the .xml to be
updated with the new data each time the .xml is modified.
In order to do this, do I have to put the code of the init() method of my
servlet in the Action class of the main page or is it a more elegant way to
do this?

Thank you  in advance,
Konstantina


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: bean passing

2002-02-05 Thread Stephen Owens

Mike,

This is a deeper question that goes back to your model and the search
implementation I think. 

I tend to keep around only the position within the result set, usually
using a 'pager' bean that calculates where I'm at, how many to display,
and where to go next/previous. When my action gets the pager values
back, it recomputes the search results, and makes them available to the
view for display. So the actual search results are not persisted between
requests. I have found that persisting large result sets is too
inefficient in DB and memory resources.

regards,

Stephen Owens
Corner Software

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: bean passing
> 
> 
> I'm new to Struts, but have read most of the doc and examples. 
> 
> One basic thing that I can't quite put a finger on: how do 
> you pass all 
> these beans around that are consumed by the jsp's?
> 
> For example, say you have a bean containing user's search 
> results.  Your 
> display page only shows 10 at a time, and uses "next" and "previous" 
> buttons.  So, you have to persist the results from page to page.
> 
> Obviously, you could explicitly add the bean to the session in the 
> action.perform(), then reference the bean with tags using 
> session scope.  
> This is essentially the same way you'd do it even if you 
> weren't using 
> Struts.  
> 
> So, is there a mechanism in Struts that I should be using instead?
> 
> Either it is simpler than I thought, or I am missing 
> something obvious.
> 
> Thanks,
> Mike
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question about ActionForm's validate method

2002-02-05 Thread Robert Scaduto

Matt,

I also disagree that you should only use actions when submitting a form.  I
also believe that in most cases you should never forward a request directly
to a jsp without first going through the Action framework.

Struts provides a utility action that will do this for you.  The
org.apache.struts.actions.ForwardAction will forward to the jsp file
specified in the parameter attribute of the action mapping. Like so..




If you are using the *.do extension in your servlet mapping you would access
the action like this...

Go to Password
Assistance

It may seem like extra work for no reason but if the requirements of your
system change and now you need to forward to an action instead of a jsp it
is much easier to replace the ForwardAction to a custom action.

It sounds to me like you are on the right track.

-Rob

-Original Message-
From: Matt Read [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:59 PM
To: Struts Users Mailing List
Subject: RE: Design question about ActionForm's validate method


I'm fairly new to struts (well, about 24 hours actually) and this message
touches on a concept that I've having trouble grasping.

Are you saying that your site should never allow the user to navigate to a
URL that maps to an Action unless you are submitting a form?

This is my example and although it's actually working in practice it doesn't
really feel right to me and doesn't conform to above rule. I hope I've
included enough detail and would appreciate any clues on good design.

1. User goes to the home page and clicks on a "Find a client" link.
2. This link points to "/find/client.do" which is defined as an
ActionMapping as follows:



3. The code in FindClientAction ensures that the user is authenticated and
then populates some request scoped attributes that enabled
/pages/findClient.jsp to function correctly. /pagesfindClient.jsp displays a
form to allow the user to enter search criteria.
4. The submit action for the form in /pages/findClient.jsp is
"/find/getresults" which is defined as an ActionMapping as follows:



5. The code in FindClientResultsAction examines the contents of the
clientFindForm and contstructs a SQL statement to retrieve the correct data.
6. /pages/findClientResults.jsp renders the results from the database.

Matt.

-Original Message-
From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2002 17:44
To: Struts Users Mailing List
Subject: Re: Design question about ActionForm's validate method



I made this same 'mistake'.

Actions MUST only be called when a form is submitted.   Never to generate
the JSP.  Thats why they are called actions.

Or two put it another way, you do need several URL's

a) URL to JSP on a GET
b) URL to action the POST

The easiert way to do it is to have all forwards going directly to the JSP,
and all actions in the pages going to .do.

At first it seems rubish, but then you hopefully buy into the model view
controller idea.  i.e NO business logic in the page and it all starts to
make perfect sence.   But you really do have to buy into it otherwise you
are fighting urge to ditch it all and go back to brilliant servlets, nice
and easy, total power etc etc.

Jonathan


 Message
History 


From: Sid Stuart <[EMAIL PROTECTED]> on 05/02/2002 09:24 PST

Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>

To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  Design question about ActionForm's validate method


Hi,

I've stumbled across a subtle problem/design question that I don't see
mentioned in the documentation.

The ActionForm's validate method can be configured to verify form data
from a page and generate error messages which may then be displayed on
the page for the user to see. This works fine when the user has accessed
the page by specifying a JSP file in the URL. When the user accesses the
page by calling the Action directly though, the validate method is
called before the user ever sees the page, much less inputs valid data
to the form. This leads to an unfortunate display of unwarranted error
messages.

It would be nice if the documentation would provide a rule such as:
If one plans on the user calling the Action directly in the URL  then
one should not use the automatic validation provided by ActionForm.

Further, as having two different procedures to generate a page can lead
to subtle errors, one should decide whether a page will be accessed as a
JSP or as an Action and design for the one scenario. The simplest (and
safest) design rule will be to access all pages through either one
mechanism or the other.

Comments?

Sid Stuart








--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy t

RE: Wizard Interface question

2002-02-05 Thread Stephen Owens

Well there's two issues there. The first is scalability, obviously
keeping your session small helps you scale, so it's a good thing for
that reason. 

The second is session persistence. I guess my position on it is that
anything you have to persist complicates the design and slows the
application down. So, even if the application server can completely
transparently handle the session persistence for your actionForm you
still incur a speed penalty for having it there. And, in general it
forces you to think about the persistence characteristics of your
actionForms, which is an issue you don't have if they're not in the
session.

So, on balance, unless there's a good reason to put something in the
session I don't. I'm curious to hear any other perspectives on this
issue as well.

regards,

Stephen Owens
Corner Software

> -Original Message-
> From: Jakkampudi, ChandraseKhar [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 1:14 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Wizard Interface question
> 
> 
> Stephen,
> Session persistence across app servers would be an 
> issue anyways if
> you put anything in the session would it not? So are you 
> suggesting that if
> a project might migrate from single app server to multiple, 
> then nothing
> should be in session scope? If atleast some objects are 
> stored in session,
> then the solution that allows all app servers to access the 
> same session
> should take care of everything. 
> 
> We haven't used multiple app servers and we are in the early stages of
> development on our project so I would really appreciate any feedback

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




bean passing

2002-02-05 Thread struts

I'm new to Struts, but have read most of the doc and examples. 

One basic thing that I can't quite put a finger on: how do you pass all 
these beans around that are consumed by the jsp's?

For example, say you have a bean containing user's search results.  Your 
display page only shows 10 at a time, and uses "next" and "previous" 
buttons.  So, you have to persist the results from page to page.

Obviously, you could explicitly add the bean to the session in the 
action.perform(), then reference the bean with tags using session scope.  
This is essentially the same way you'd do it even if you weren't using 
Struts.  

So, is there a mechanism in Struts that I should be using instead?

Either it is simpler than I thought, or I am missing something obvious.

Thanks,
Mike


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Jakkampudi, ChandraseKhar

This link should help you

http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/template/p
ackage-summary.html#package_description



-Original Message-
From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:11 PM
To: Struts Users Mailing List
Subject: RE: Jsp in another Jsp using struts




could u please explain me how to use templates...

Thanks in advance
Kalpana

On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> If you want to include the file as a footer consider 
> using the template
> taglibs.  
> 
> Include can be used anywhere not just at the top but 
> for your problem using
> templates would be a better idea.
> 
> 
> -Original Message-
> From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> m]
> Sent: Tuesday, February 05, 2002 12:01 PM
> To: Struts Users Mailing List
> Subject: RE: Jsp in another Jsp using struts
> 
> 
> 
> I want to add a jsp page as a footer/bottom to every 
> other Jsp pages 
> 
> but <%@ include file="xxx.jsp" %> is used at the top i 
> guess???
> 
> Thanks in advance
> Kalpana
> 
> On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> > You dont need struts for this. Just use
> > 
> > <%@ include file="xxx.jsp" %> wherever you want to 
> > insert your JSP file.
> > 
> > 
> > -Original Message-
> > From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> co-
> > m]
> > Sent: Tuesday, February 05, 2002 11:54 AM
> > To: Struts Users Mailing List
> > Subject: Jsp in another Jsp using struts
> > 
> > 
> > 
> > Hi
> > 
> > Can anyone tell me how can i include a jsp page into 
> > another jsp using
> > struts???
> > 
> > thanks in advance
> > Kalpana 
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> > 
> > --
> > To unsubscribe, e-mail:    ib-
> > [EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > 
> > 
>  
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail: 
> 
> 
 


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: error display

2002-02-05 Thread Henry Lu

Great! It works now! Thank you very much!


---
Henry Lu
MCITphone: (734) 936-2063
University of Michigan Medical Center   fax:   (734) 763-4372

On Tue, 5 Feb 2002, Jakkampudi, ChandraseKhar wrote:

> You have a typo.
> Change your validate to
>   new ActionError("errors.id.required", "id=123"));
>
>  or your ApplicationResources.properties to
> error.id.required= blah
>
> Note the 's' at the end of errors in your applicationresources file
>
>
> -Original Message-
> From: Henry Lu [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 12:03 PM
> To: Pavel Nejedly
> Cc: Struts Users Mailing List
> Subject: Re: error display
>
>
> Here is my ApplicationResource.properties file used ./classes
> directory
>
> errors.header=
> errors.footer=
> errors.id.required=id is required.
> ---
> Here is my validate() function
>
>   if (id == null || id.equals("123") == false) {
>  errors.add(ActionErrors.GLOBAL_ERROR,
> new ActionError("error.id.required", "id=123"));
>   }
> ---
> Here is my jsp file
>
> Hello, STRUTS! Enter ID:
> 
> 
>
> 
> ---
>
> Did I miss something?
>
> Thanks,
>
>
> ---
> Henry Lu
> MCITphone: (734) 936-2063
> University of Michigan Medical Center   fax:   (734) 763-4372
>
> On Tue, 5 Feb 2002, Pavel Nejedly wrote:
>
> > On Tue, Feb 05, 2002 at 12:30:25PM -0500, Henry Lu wrote:
> > # Here is my code:
> > #   errors.add(ActionErrors.GLOBAL_ERROR,
> > # new ActionError("error.id.required", "id=123"));
> >
> >   then you have to provide message for the key "error.id.required".
> >   check the content of the file you specified as application parameter
> >   of the ActionServlet.
> >   eg. if you have
> >
> >   
> >   action
> >
> org.apache.struts.action.ActionServlet
> > 
> >   application
> >   my.Msg
> >
> >   then the properties file should be one of
> WEB-INF/classes/my/Msg.properties,
> >   WEB-INF/classes/my/Msg_xx.properties or
> WEB-INF/classes/my/Msg_xx_YY.properties
> >   where xx_YY is the current locale
> >
> >   the appropriate properties file should contain
> >
> >   error.id.required=You must supply a valid id.
> >
> >   or something like this.
> >
> >   Does it help?
> >
> > # Could you send me part of your code?
> >
> >   it looks the same... :)
> >
> >   Pavel
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Wizard Interface question

2002-02-05 Thread Jakkampudi, ChandraseKhar

Stephen,
Session persistence across app servers would be an issue anyways if
you put anything in the session would it not? So are you suggesting that if
a project might migrate from single app server to multiple, then nothing
should be in session scope? If atleast some objects are stored in session,
then the solution that allows all app servers to access the same session
should take care of everything. 

We haven't used multiple app servers and we are in the early stages of
development on our project so I would really appreciate any feedback

-Original Message-
From: Stephen Owens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:02 PM
To: Struts Users Mailing List
Subject: RE: Wizard Interface question


Taylor,

Just to clarify. Putting the ActionForm in the session is simpler, but
it doesn't scale as well because your session grows. It also is one more
thing to worry about if you have multiple application servers and you
need to support failover. So, while I agree that session beans are an
option, I think in general you should avoid them where you can.

regards,

Stephen Owens
Corner Software

> -Original Message-
> From: Taylor Cowan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 12:33 PM
> To: Struts Users Mailing List
> Subject: RE: Wizard Interface question
> 
> 
> All that is not necessary.  You can have the ActionForm bean placed in
> session scope, and allow different JSP pages to fill out the 
> properties.
> 
> This is configured in the struts config file.
> 

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Kalpana RamiReddy



could u please explain me how to use templates...

Thanks in advance
Kalpana

On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> If you want to include the file as a footer consider 
> using the template
> taglibs.  
> 
> Include can be used anywhere not just at the top but 
> for your problem using
> templates would be a better idea.
> 
> 
> -Original Message-
> From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> m]
> Sent: Tuesday, February 05, 2002 12:01 PM
> To: Struts Users Mailing List
> Subject: RE: Jsp in another Jsp using struts
> 
> 
> 
> I want to add a jsp page as a footer/bottom to every 
> other Jsp pages 
> 
> but <%@ include file="xxx.jsp" %> is used at the top i 
> guess???
> 
> Thanks in advance
> Kalpana
> 
> On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> > You dont need struts for this. Just use
> > 
> > <%@ include file="xxx.jsp" %> wherever you want to 
> > insert your JSP file.
> > 
> > 
> > -Original Message-
> > From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> co-
> > m]
> > Sent: Tuesday, February 05, 2002 11:54 AM
> > To: Struts Users Mailing List
> > Subject: Jsp in another Jsp using struts
> > 
> > 
> > 
> > Hi
> > 
> > Can anyone tell me how can i include a jsp page into 
> > another jsp using
> > struts???
> > 
> > thanks in advance
> > Kalpana 
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> > 
> > --
> > To unsubscribe, e-mail:    ib-
> > [EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > 
> > 
>  
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail: 
> 
> 
 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: error display

2002-02-05 Thread Pavel Nejedly

On Tue, Feb 05, 2002 at 01:03:18PM -0500, Henry Lu wrote:
# Here is my ApplicationResource.properties file used ./classes
# directory
# 
# errors.header=
# errors.footer=
# errors.id.required=id is required.
# ---
# Here is my validate() function
# 
#   if (id == null || id.equals("123") == false) {
#  errors.add(ActionErrors.GLOBAL_ERROR,
# new ActionError("error.id.required", "id=123"));
#   }
# ---

  you have mis-spelled the error key - in ApplicationResource.properties
  you have 'errors', but in the form only 'error'.

  Btw. I suggest you put the error message inside , so that 
   1) you have correct html
   2) if there were more errors, the would have their own lines in the
  list

  Pavel

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Jakkampudi, ChandraseKhar

If you want to include the file as a footer consider using the template
taglibs.  

Include can be used anywhere not just at the top but for your problem using
templates would be a better idea.


-Original Message-
From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:01 PM
To: Struts Users Mailing List
Subject: RE: Jsp in another Jsp using struts



I want to add a jsp page as a footer/bottom to every other Jsp pages 

but <%@ include file="xxx.jsp" %> is used at the top i guess???

Thanks in advance
Kalpana

On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> You dont need struts for this. Just use
> 
> <%@ include file="xxx.jsp" %> wherever you want to 
> insert your JSP file.
> 
> 
> -Original Message-
> From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> m]
> Sent: Tuesday, February 05, 2002 11:54 AM
> To: Struts Users Mailing List
> Subject: Jsp in another Jsp using struts
> 
> 
> 
> Hi
> 
> Can anyone tell me how can i include a jsp page into 
> another jsp using
> struts???
> 
> thanks in advance
> Kalpana 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail: 
> 
> 
 


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Krueger, Jeff

I think you want to use templates.  That should solve your problem

Jeff Krueger


-Original Message-
From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 11:01 AM
To: Struts Users Mailing List
Subject: RE: Jsp in another Jsp using struts



I want to add a jsp page as a footer/bottom to every other Jsp pages 

but <%@ include file="xxx.jsp" %> is used at the top i guess???

Thanks in advance
Kalpana

On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> You dont need struts for this. Just use
> 
> <%@ include file="xxx.jsp" %> wherever you want to 
> insert your JSP file.
> 
> 
> -Original Message-
> From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> m]
> Sent: Tuesday, February 05, 2002 11:54 AM
> To: Struts Users Mailing List
> Subject: Jsp in another Jsp using struts
> 
> 
> 
> Hi
> 
> Can anyone tell me how can i include a jsp page into 
> another jsp using
> struts???
> 
> thanks in advance
> Kalpana 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail: 
> 
> 
 


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: error display

2002-02-05 Thread Jakkampudi, ChandraseKhar

You have a typo.
Change your validate to 
  new ActionError("errors.id.required", "id=123"));

 or your ApplicationResources.properties to 
error.id.required= blah

Note the 's' at the end of errors in your applicationresources file


-Original Message-
From: Henry Lu [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:03 PM
To: Pavel Nejedly
Cc: Struts Users Mailing List
Subject: Re: error display


Here is my ApplicationResource.properties file used ./classes
directory

errors.header=
errors.footer=
errors.id.required=id is required.
---
Here is my validate() function

  if (id == null || id.equals("123") == false) {
 errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.id.required", "id=123"));
  }
---
Here is my jsp file

Hello, STRUTS! Enter ID:




---

Did I miss something?

Thanks,


---
Henry Lu
MCITphone: (734) 936-2063
University of Michigan Medical Center   fax:   (734) 763-4372

On Tue, 5 Feb 2002, Pavel Nejedly wrote:

> On Tue, Feb 05, 2002 at 12:30:25PM -0500, Henry Lu wrote:
> # Here is my code:
> #   errors.add(ActionErrors.GLOBAL_ERROR,
> # new ActionError("error.id.required", "id=123"));
>
>   then you have to provide message for the key "error.id.required".
>   check the content of the file you specified as application parameter
>   of the ActionServlet.
>   eg. if you have
>
>   
>   action
>
org.apache.struts.action.ActionServlet
> 
>   application
>   my.Msg
>
>   then the properties file should be one of
WEB-INF/classes/my/Msg.properties,
>   WEB-INF/classes/my/Msg_xx.properties or
WEB-INF/classes/my/Msg_xx_YY.properties
>   where xx_YY is the current locale
>
>   the appropriate properties file should contain
>
>   error.id.required=You must supply a valid id.
>
>   or something like this.
>
>   Does it help?
>
> # Could you send me part of your code?
>
>   it looks the same... :)
>
>   Pavel
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Kalpana RamiReddy


I want to add a jsp page as a footer/bottom to every other Jsp pages 

but <%@ include file="xxx.jsp" %> is used at the top i guess???

Thanks in advance
Kalpana

On Tue, 05 Feb 2002 Jakkampudi, ChandraseKhar wrote :
> You dont need struts for this. Just use
> 
> <%@ include file="xxx.jsp" %> wherever you want to 
> insert your JSP file.
> 
> 
> -Original Message-
> From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]
> m]
> Sent: Tuesday, February 05, 2002 11:54 AM
> To: Struts Users Mailing List
> Subject: Jsp in another Jsp using struts
> 
> 
> 
> Hi
> 
> Can anyone tell me how can i include a jsp page into 
> another jsp using
> struts???
> 
> thanks in advance
> Kalpana 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail: 
> 
> 
 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Next release of Struts

2002-02-05 Thread Ted Husted

Yes, we are pretty much at feature lock, and working toward a release
candidate. Mostly documentation and testing of the newest features.

Adam wrote:
> 
> Struts is really picking up momentum, being written about in the new
> Java TOols for XP and on the boards over at The Serverside and
> elsewhere.  I'd like to point more people to oward it, but there is so
> much required functionality that is only in the nightly builds.  Is
> there a timeline/target for the next release of struts, with the current
> functionality?  Is there a discussion going on about this somewhere
>  that I am missing?
> 
> Adam
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: error display

2002-02-05 Thread Henry Lu

Here is my ApplicationResource.properties file used ./classes
directory

errors.header=
errors.footer=
errors.id.required=id is required.
---
Here is my validate() function

  if (id == null || id.equals("123") == false) {
 errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.id.required", "id=123"));
  }
---
Here is my jsp file

Hello, STRUTS! Enter ID:




---

Did I miss something?

Thanks,


---
Henry Lu
MCITphone: (734) 936-2063
University of Michigan Medical Center   fax:   (734) 763-4372

On Tue, 5 Feb 2002, Pavel Nejedly wrote:

> On Tue, Feb 05, 2002 at 12:30:25PM -0500, Henry Lu wrote:
> # Here is my code:
> #   errors.add(ActionErrors.GLOBAL_ERROR,
> # new ActionError("error.id.required", "id=123"));
>
>   then you have to provide message for the key "error.id.required".
>   check the content of the file you specified as application parameter
>   of the ActionServlet.
>   eg. if you have
>
>   
>   action
>   org.apache.struts.action.ActionServlet
> 
>   application
>   my.Msg
>
>   then the properties file should be one of WEB-INF/classes/my/Msg.properties,
>   WEB-INF/classes/my/Msg_xx.properties or WEB-INF/classes/my/Msg_xx_YY.properties
>   where xx_YY is the current locale
>
>   the appropriate properties file should contain
>
>   error.id.required=You must supply a valid id.
>
>   or something like this.
>
>   Does it help?
>
> # Could you send me part of your code?
>
>   it looks the same... :)
>
>   Pavel
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Thread Safety Question (was Formatting Dates, Integers...)

2002-02-05 Thread Greg Hess

Very interesting, thank you Jeff.

I am using an instance of the date format class as a private member variable
in one of my buisiness objects. Each client request has one of these
business objects created and placed into the session for use, as mentioned
previously I too use a new getter method to provide formated dates to my
jsp's. I believe this use is thread safe in that I am not creating any new
threads in my app.

Some developers have mentioned that the DateFormat objects are heavy
weight(too heavy for each client session?). Should the date format object
only have local scope in a method or be a globaly syncronized object for all
to use?



-Original Message-
From: Jeff Martin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 12:26 PM
To: Struts Users Mailing List
Subject: RE: Thread Safety Question (was Formatting Dates, Integers...)


Any use of java.text.DateFormat (or its subclasses) format method is thread
unsafe (quite to my surprise). The problem comes from DateFormat holding an
instance of a Calendar to help it break the java.util.Date into pieces.

When a second thread calls format() while another thread is still in
format(), it naturally starts poking the new month/day/etc into the [same!]
calendar, overwriting what the first thread put there [and is still using].
It goes downhill from there. I got anything from garbled/mixed dates to
NullPointerExceptions, depending on when and where the two threads were.

Jeff

-Original Message-
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 5:12 AM
To: Struts Users Mailing List
Subject: Thread Safety Question (was Formatting Dates, Integers...)


Do you know what the problem was that made your use of format objects
non-thread safe?

> -Original Message-
> From: Jeff Martin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 5:56 PM
> To: Struts Users Mailing List
> Subject: RE: Formatting Dates, Integers...
>
>
> Be very careful about using DateFormatter's that way. I learned a hard
> lesson in a previous project that DateFormater (and even just the format
> method) is not thread safe.
>
> Jeff
>




--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Wizard Interface question

2002-02-05 Thread Stephen Owens

Taylor,

Just to clarify. Putting the ActionForm in the session is simpler, but
it doesn't scale as well because your session grows. It also is one more
thing to worry about if you have multiple application servers and you
need to support failover. So, while I agree that session beans are an
option, I think in general you should avoid them where you can.

regards,

Stephen Owens
Corner Software

> -Original Message-
> From: Taylor Cowan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 12:33 PM
> To: Struts Users Mailing List
> Subject: RE: Wizard Interface question
> 
> 
> All that is not necessary.  You can have the ActionForm bean placed in
> session scope, and allow different JSP pages to fill out the 
> properties.
> 
> This is configured in the struts config file.
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Wizard Interface question / Hi Taylor

2002-02-05 Thread Keith Bacon


--- Guillaume Labelle <[EMAIL PROTECTED]> wrote:
> Hi Taylor, are you the Taylor that used to work for Brightstar in Dallas
> 
> 
> 
> - Original Message -
> From: "Taylor Cowan" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 12:33 PM
> Subject: RE: Wizard Interface question
> 
> 
> > All that is not necessary.  You can have the ActionForm bean placed in
> > session scope, and allow different JSP pages to fill out the properties.
> >
> > This is configured in the struts config file.
> >
> > Taylor
> >
> > -Original Message-
> > From: Stephen Owens [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 05, 2002 9:55 AM
> > To: Struts Users Mailing List
> > Subject: RE: Wizard Interface question
> >
> >
> > Peter,
> >
> > Actually, for wizards I have usually just created a single large
> > actionForm that has all the fields for all pages of the wizard and I
> > just have it in the request. I use hidden fields on other pages of the
> > wizard to carry the values from page to page. That way the page designer
> > can dynamically move fields to any page they want without modifying the
> > layout of the actionForm.
> >
> > regards,
> >
> > Stephen Owens
> > Corner Software
> >
> > > -Original Message-
> > > From: Pete Serafin [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, February 05, 2002 10:53 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Wizard Interface question
> > >
> > >
> > > I am trying to develop an interface for entering data for one object
> > > across multiple forms as in a wizard interface.  Can anyone
> > > describe the
> > > best way to approach the design of this type of functionality.  I was
> > > thinking that the actionforms would be stored in the user
> > > session until
> > > a submit to database or a cancel is requested.  Is this the
> > > best way to
> > > handle this?  Thanks,
> > >
> > >
> > > Pete Serafin
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > 
> > > For additional commands, e-mail:
> > > 
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> 
> 
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question about ActionForm's validate method

2002-02-05 Thread Matt Read

I'm fairly new to struts (well, about 24 hours actually) and this message
touches on a concept that I've having trouble grasping.

Are you saying that your site should never allow the user to navigate to a
URL that maps to an Action unless you are submitting a form?

This is my example and although it's actually working in practice it doesn't
really feel right to me and doesn't conform to above rule. I hope I've
included enough detail and would appreciate any clues on good design.

1. User goes to the home page and clicks on a "Find a client" link.
2. This link points to "/find/client.do" which is defined as an
ActionMapping as follows:



3. The code in FindClientAction ensures that the user is authenticated and
then populates some request scoped attributes that enabled
/pages/findClient.jsp to function correctly. /pagesfindClient.jsp displays a
form to allow the user to enter search criteria.
4. The submit action for the form in /pages/findClient.jsp is
"/find/getresults" which is defined as an ActionMapping as follows:



5. The code in FindClientResultsAction examines the contents of the
clientFindForm and contstructs a SQL statement to retrieve the correct data.
6. /pages/findClientResults.jsp renders the results from the database.

Matt.

-Original Message-
From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2002 17:44
To: Struts Users Mailing List
Subject: Re: Design question about ActionForm's validate method



I made this same 'mistake'.

Actions MUST only be called when a form is submitted.   Never to generate
the JSP.  Thats why they are called actions.

Or two put it another way, you do need several URL's

a) URL to JSP on a GET
b) URL to action the POST

The easiert way to do it is to have all forwards going directly to the JSP,
and all actions in the pages going to .do.

At first it seems rubish, but then you hopefully buy into the model view
controller idea.  i.e NO business logic in the page and it all starts to
make perfect sence.   But you really do have to buy into it otherwise you
are fighting urge to ditch it all and go back to brilliant servlets, nice
and easy, total power etc etc.

Jonathan


 Message
History 


From: Sid Stuart <[EMAIL PROTECTED]> on 05/02/2002 09:24 PST

Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>

To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  Design question about ActionForm's validate method


Hi,

I've stumbled across a subtle problem/design question that I don't see
mentioned in the documentation.

The ActionForm's validate method can be configured to verify form data
from a page and generate error messages which may then be displayed on
the page for the user to see. This works fine when the user has accessed
the page by specifying a JSP file in the URL. When the user accesses the
page by calling the Action directly though, the validate method is
called before the user ever sees the page, much less inputs valid data
to the form. This leads to an unfortunate display of unwarranted error
messages.

It would be nice if the documentation would provide a rule such as:
If one plans on the user calling the Action directly in the URL  then
one should not use the automatic validation provided by ActionForm.

Further, as having two different procedures to generate a page can lead
to subtle errors, one should decide whether a page will be accessed as a
JSP or as an Action and design for the one scenario. The simplest (and
safest) design rule will be to access all pages through either one
mechanism or the other.

Comments?

Sid Stuart








--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Jsp in another Jsp using struts

2002-02-05 Thread Jakkampudi, ChandraseKhar

You dont need struts for this. Just use

<%@ include file="xxx.jsp" %> wherever you want to insert your JSP file.


-Original Message-
From: Kalpana RamiReddy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 11:54 AM
To: Struts Users Mailing List
Subject: Jsp in another Jsp using struts



Hi

Can anyone tell me how can i include a jsp page into another jsp using
struts???

thanks in advance
Kalpana 


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Jsp in another Jsp using struts

2002-02-05 Thread Kalpana RamiReddy


Hi

Can anyone tell me how can i include a jsp page into another jsp using struts???

thanks in advance
Kalpana 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Wizard Interface question / Hi Taylor

2002-02-05 Thread Guillaume Labelle

Hi Taylor, are you the Taylor that used to work for Brightstar in Dallas



- Original Message -
From: "Taylor Cowan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 12:33 PM
Subject: RE: Wizard Interface question


> All that is not necessary.  You can have the ActionForm bean placed in
> session scope, and allow different JSP pages to fill out the properties.
>
> This is configured in the struts config file.
>
> Taylor
>
> -Original Message-
> From: Stephen Owens [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 9:55 AM
> To: Struts Users Mailing List
> Subject: RE: Wizard Interface question
>
>
> Peter,
>
> Actually, for wizards I have usually just created a single large
> actionForm that has all the fields for all pages of the wizard and I
> just have it in the request. I use hidden fields on other pages of the
> wizard to carry the values from page to page. That way the page designer
> can dynamically move fields to any page they want without modifying the
> layout of the actionForm.
>
> regards,
>
> Stephen Owens
> Corner Software
>
> > -Original Message-
> > From: Pete Serafin [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 05, 2002 10:53 AM
> > To: [EMAIL PROTECTED]
> > Subject: Wizard Interface question
> >
> >
> > I am trying to develop an interface for entering data for one object
> > across multiple forms as in a wizard interface.  Can anyone
> > describe the
> > best way to approach the design of this type of functionality.  I was
> > thinking that the actionforms would be stored in the user
> > session until
> > a submit to database or a cancel is requested.  Is this the
> > best way to
> > handle this?  Thanks,
> >
> >
> > Pete Serafin
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: J2EE BluePrints and Struts

2002-02-05 Thread Adam

Looks good.  I like the command to iteration set up.

Would a page object help?  I realize that this would sort of be an 
iterator of iterators.

Also, does making the contstuctor public make sense?  Ususally the 
command acts as the factory for the iterator.

An alternative is the builder pattern:   The PageDirector calls 
addElement to the PageIteratorBuilder.  When complete, call getIterator, 
which detaches the Iterator and returns it.  It really depends on 
whether you want the Iterator to be updatable or not. You may want to 
have a non updatable one, and then an updatable one that extends it.






SIROLLI PIERRE wrote:

>--- Reçu de   RVIDOI.SIROLLPI 62607  05/02/02 16.05
>
>Please find attached an UML representation of the implementation of the page
>by page iterator.
>It provides places  where you can plug into the model (execute(),
>fetchsize)and the rest (eg the utility layer "movecursor,size.." ) is left to
>the implementation.
>
>Pierre
>
>--
>
>Date: Tue, 5 Feb 2002 08:58:37 -0500
>Subject: Re: J2EE BluePrints and Struts
>
>Oleg had a pager as part of his BeanFactory, but that was never made
>part of the framework. Perhaps he will get back to that after the
>ServiceManager work (Go Oleg!).
>
>Generally, these type of model-centric patterns do not need be a part of
>the core framework. The framework provides places where you can plug
>into the model (Actions). And ways to pass control back and forth
>between the View (struts-config elements). But the implementation of
>something like paging is an excercise left to the developer.
>
>A patterns-based approach to paging might be something I would put into
>the optional Scaffold package, which has a number of
>implementation-pattern type classes.
>
>
>SIROLLI PIERRE wrote:
>
>>--- Reçu de   RVIDOI.SIROLLPI 62607  05/02/02 09.26
>>
>>Ted,
>>
>>I wrote an implementation of the page by page iterator J2EE design pattern.
>>Is this pattern already implemented in Struts ?
>>
>>Pierre
>>
>>
>>
>>Date: Mon, 4 Feb 2002 06:07:20 -0500
>>Subject: Re: J2EE BluePrints and Struts
>>
>>This type of message can also be posted to the USER list, since it does
>>not involve the present or future development of Struts.
>>
>>But anyway, the Blueprints are just that -- plans. Struts implements
>>many of the patterns and strategies described in the BluePrints and in
>>Core J2EE Patterns
>>
>>http://www.amazon.com/exec/obidos/ISBN=0130648841/hitchhikeguidetoA/
>>
>>But was doing so before each of these were released, based on prior
>>patterns literature. In fact, Struts code was used as the example
>>implementation for Synchronizer Token strategy.
>>
>>Working from the Core J2EE Patterns terminology, Struts employs a number
>>of cataloged patterns, including
>>
>>Service to Worker (ActionServlet, Action classes, ContextHelper),
>>Front Controller, Singleton (ActionServlet),
>>Dispatcher, View Helper, Session Facade, Singleton (Action classes),
>>Value Objects (ActionForm, ActionErrors),
>>View Helper (ActionForm, ContextHelper, tag extensions),
>>Composite View (Template and Tiles taglibs),
>>Synchronizer Token (Action class methods).
>>
>>-- Ted Husted, Husted dot Com, Fairport NY USA.
>>-- Java Web Development with Struts.
>>-- Tel +1 585 737-3463.
>>-- Web http://www.husted.com/struts/
>>
>>[EMAIL PROTECTED] wrote:
>>
>>>Hi,
>>>
>>>I am new to this framework and to this list. Can anybody tell me how this
>>>framework differs from the Sun's framework J2EE BluePrints ?
>>>What is the strength of the framework when compared to the BluePrints?
>>>
>>>If there are any articles available, please let me know.
>>>
>>--
>>To unsubscribe, e-mail:   
>>For additional commands, e-mail: 
>>
>> 05/02/02 09.26  Envoyé à  -
>>  -> husted(a)apache.org
>>  -> struts-dev(a)jakarta.apache.org
>>
>
>-- Ted Husted, Husted dot Com, Fairport NY USA.
>-- Java Web Development with Struts.
>-- Tel +1 585 737-3463.
>-- Web http://www.husted.com/struts/
>
> 05/02/02 16.05  Envoyé à  ---
>  -> husted(a)apache.org
> CC:
>  -> struts-user(a)jakarta.apache.org
>
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: error display

2002-02-05 Thread Pavel Nejedly

On Tue, Feb 05, 2002 at 12:30:25PM -0500, Henry Lu wrote:
# Here is my code:
#   errors.add(ActionErrors.GLOBAL_ERROR,
# new ActionError("error.id.required", "id=123"));

  then you have to provide message for the key "error.id.required".
  check the content of the file you specified as application parameter
  of the ActionServlet.
  eg. if you have 
  
  
  action
  org.apache.struts.action.ActionServlet

  application
  my.Msg

  then the properties file should be one of WEB-INF/classes/my/Msg.properties,
  WEB-INF/classes/my/Msg_xx.properties or WEB-INF/classes/my/Msg_xx_YY.properties
  where xx_YY is the current locale

  the appropriate properties file should contain

  error.id.required=You must supply a valid id.

  or something like this.

  Does it help?
  
# Could you send me part of your code?

  it looks the same... :)

  Pavel

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Could not locate TLD META-INF/taglib.tld --Again

2002-02-05 Thread Bob Williams

Please ignore this message!  I found the errorjust DUMB!

bob

- Original Message -
From: "Bob Williams" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 11:27 AM
Subject: Could not locate TLD META-INF/taglib.tld --Again


>
> I am getting the message: Could not locate TLD META-INF/taglib.tld  when
> trying to compile a project in Forte v3.  This problem has been reported
> before and the solution suggested by Andy Noble doesn't seem to be working
> for me.  I have the TLD's in WEB-INF directory and open the appropriate
> TLD's before compiling as suggested, but still get the error message.
>
> Anyone have an answer?
>
> Bob Williams
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Design question about ActionForm's validate method

2002-02-05 Thread Jonathan Gibbons


I made this same 'mistake'.

Actions MUST only be called when a form is submitted.   Never to generate the JSP.  
Thats why they are called actions.

Or two put it another way, you do need several URL's

a) URL to JSP on a GET
b) URL to action the POST

The easiert way to do it is to have all forwards going directly to the JSP, and all 
actions in the pages going to .do.

At first it seems rubish, but then you hopefully buy into the model view controller 
idea.  i.e NO business logic in the page and it all starts to make perfect sence.   
But you really do have to buy into it otherwise you are fighting urge to ditch it all 
and go back to brilliant servlets, nice and easy, total power etc etc.

Jonathan


 Message History 



From: Sid Stuart <[EMAIL PROTECTED]> on 05/02/2002 09:24 PST

Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>

To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  Design question about ActionForm's validate method


Hi,

I've stumbled across a subtle problem/design question that I don't see
mentioned in the documentation.

The ActionForm's validate method can be configured to verify form data
from a page and generate error messages which may then be displayed on
the page for the user to see. This works fine when the user has accessed
the page by specifying a JSP file in the URL. When the user accesses the
page by calling the Action directly though, the validate method is
called before the user ever sees the page, much less inputs valid data
to the form. This leads to an unfortunate display of unwarranted error
messages.

It would be nice if the documentation would provide a rule such as:
If one plans on the user calling the Action directly in the URL  then
one should not use the automatic validation provided by ActionForm.

Further, as having two different procedures to generate a page can lead
to subtle errors, one should decide whether a page will be accessed as a
JSP or as an Action and design for the one scenario. The simplest (and
safest) design rule will be to access all pages through either one
mechanism or the other.

Comments?

Sid Stuart








--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question about ActionForm's validate method

2002-02-05 Thread Robert Nocera


Direct the user to an action that isn't the action associated with the
page in question, even if all that action does is forward to the JSP
page.  Generally the action's associated with a JSP page get called from
that JSP page.

ActionA forwards to B.JSP, B.JSP submits to ActionB and so on...

Alternately provide a hidden form variable in your page, in your
validation method, check for it, if it's not there, don't continue
validating as the user did not just submit the page.

Robert Nocera
New England Open Solutions
www.neosllc.com
"You supply the vision, we'll do the rest."
 

-Original Message-
From: Sid Stuart [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 05, 2002 12:25 PM
To: Struts Users Mailing List
Subject: Design question about ActionForm's validate method

Hi,

I've stumbled across a subtle problem/design question that I don't see
mentioned in the documentation.

The ActionForm's validate method can be configured to verify form data
from a page and generate error messages which may then be displayed on
the page for the user to see. This works fine when the user has accessed
the page by specifying a JSP file in the URL. When the user accesses the
page by calling the Action directly though, the validate method is
called before the user ever sees the page, much less inputs valid data
to the form. This leads to an unfortunate display of unwarranted error
messages.

It would be nice if the documentation would provide a rule such as:
If one plans on the user calling the Action directly in the URL  then
one should not use the automatic validation provided by ActionForm.

Further, as having two different procedures to generate a page can lead
to subtle errors, one should decide whether a page will be accessed as a
JSP or as an Action and design for the one scenario. The simplest (and
safest) design rule will be to access all pages through either one
mechanism or the other.

Comments?

Sid Stuart




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Wizard Interface question

2002-02-05 Thread Taylor Cowan

All that is not necessary.  You can have the ActionForm bean placed in
session scope, and allow different JSP pages to fill out the properties.

This is configured in the struts config file.

Taylor

-Original Message-
From: Stephen Owens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 9:55 AM
To: Struts Users Mailing List
Subject: RE: Wizard Interface question


Peter,

Actually, for wizards I have usually just created a single large
actionForm that has all the fields for all pages of the wizard and I
just have it in the request. I use hidden fields on other pages of the
wizard to carry the values from page to page. That way the page designer
can dynamically move fields to any page they want without modifying the
layout of the actionForm.

regards,

Stephen Owens
Corner Software

> -Original Message-
> From: Pete Serafin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 10:53 AM
> To: [EMAIL PROTECTED]
> Subject: Wizard Interface question
>
>
> I am trying to develop an interface for entering data for one object
> across multiple forms as in a wizard interface.  Can anyone
> describe the
> best way to approach the design of this type of functionality.  I was
> thinking that the actionforms would be stored in the user
> session until
> a submit to database or a cancel is requested.  Is this the
> best way to
> handle this?  Thanks,
>
>
> Pete Serafin
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: error display

2002-02-05 Thread Henry Lu

Here is my code:
  errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.id.required", "id=123"));

Could you send me part of your code?

Thanks,


---
Henry Lu
MCITphone: (734) 936-2063
University of Michigan Medical Center   fax:   (734) 763-4372

On Tue, 5 Feb 2002, Pavel Nejedly wrote:

> On Tue, Feb 05, 2002 at 12:12:40PM -0500, Henry Lu wrote:
> # I did. I include
> #
> # 
> #
> # in a jsp file. But when validate() function finds error, the jsp page
> # displays something like:
> #
> # 
> # 
> #
> # on the screen.
> #
> # Why?
>
>   Have you provided the messages for all the keys inserted into
>   ActionErrors? I experienced the same behavior when I forgot to
>   include them.
>
>   Pavel
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Wizard Interface question

2002-02-05 Thread Jakkampudi, ChandraseKhar

I never said that the approach you outlined will not work. What I said was
it will probably not work if you need transactional control. Let me clarify.

Consider the case of a wizard interface  where you have contact info on one
form (or tab if you will) and billing info on another tab. Now storing just
the contact info in the db when the first form is submitted will leave your
database in an inconsistent state if the user does not complete the second
form and cancels out of the registration. Storing the information in the
session will allow you to have all the required data even if the UI
designers decide to move fields around in the tabs. All of the data can be
written to the database on the final submit.

If you mean a temporary database that holds the data from each form and then
you update all of your required data at one time on the final submit then
obviously your approach will work also. In that case your temp db (I am
assuming this is maintained by the webAppWriter) is just replacing the
session. 

PS: I have not used either Expresso or webAppWriter which explains why I say
"probably" and "I think" in my emails.


-Original Message-
From: Pete Carapetyan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 10:44 AM
To: Struts Users Mailing List
Subject: Re: Wizard Interface question


"Jakkampudi, ChandraseKhar" wrote:

> I dont think this approach will work if you need transactional control
> across the different "tabs" of the wizard. For example if it is a
> registration wizard that collects contact info and billing info on
different
> tabs, using different forms and commiting to the database will leave you
> with a lot of problems.

Perhaps I do not understand what you are saying, but Expresso does this all
day
every day, and it has worked like a charm for (years?).

When you create a registration app with webAppWriter, for example, you can
have
any number of tables as registration requirements, and each have it's own
CRUD
views separately maintained, or alternatively, one set of MVC  CRUD views
for the
whole thing, while still maintaining each table as a separate registration
requirement.

If you don't believe it, go to webAppWriter.com and create a registration
app.
Takes about 10 minutes, plus a few minutes to wait for the zip file in your
email. There are also tutorials on how to set up a quick Expresso test
installation, so you won't mess with your existing apps or app server.

Results, not theory about what won't work and why. But then again, if you
can
shoot holes in it, that is fine too.

> We use a single form and store it in the session rather than the request
> eliminating the need for the hidden variables as proposed by somebody
else.
>
> I notice that this is what you originally proposed. This approach works
very
> well for us (thought there is a bit of clean-up at the cancel or submit)
>
> -Original Message-
> From: Pete Carapetyan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 10:22 AM
> To: Struts Users Mailing List
> Subject: Re: Wizard Interface question
>
> Pete Serafin wrote:
>
> > I am trying to develop an interface for entering data for one object
> > across multiple forms as in a wizard interface.  Can anyone describe the
> > best way to approach the design of this type of functionality.
>
> Doubt that there is any one right way, but webAppWriter keeps everything
in
> a
> database, and uses many different forms, one for each of the CRUD
operations
> for
> each of the three tables it maintains (App, Tables, Fields). Lots of
forms,
> but
> each only has to do one thing.
>
> This approach allows anyone to start or stop anywhere within the process,
> and
> their state is always intact and can be picked up at any stage within the
> process.
>
> Oddly enough, this same thing is true of each of the applications it
> produces,
> though I never thought of them as Wizard forms before. To be a wizard, all
> it
> takes is some result that happens after the data is sucked in.
>
> It would seem that this is much more scalable than sticking everything in
a
> session, but it was also a lot easier for me to do this way. It seems to
be
> the
> way Expresso is designed to work.  Plus, users would go nuts if they had
to
> get
> everything done in a session.
>
> Does it work ? Has about 9 months without a problem, though only since
> posting on
> the struts resource page has it been getting heavy use.
>
> > I was
> > thinking that the actionforms would be stored in the user session until
> > a submit to database or a cancel is requested.  Is this the best way to
> > handle this?  Thanks,
> >
> > Pete Serafin
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
>
> --
> Pete Carapetyan
> http://datafundamentals.com
> Java Development Services
>
> Open standards technology for commercial profitability
>
> --
> To unsubscribe, e-mail:
> 
> For addi

Next release of Struts

2002-02-05 Thread Adam

Struts is really picking up momentum, being written about in the new 
Java TOols for XP and on the boards over at The Serverside and 
elsewhere.  I'd like to point more people to oward it, but there is so 
much required functionality that is only in the nightly builds.  Is 
there a timeline/target for the next release of struts, with the current 
functionality?  Is there a discussion going on about this somewhere 
 that I am missing?

Adam



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Could not locate TLD META-INF/taglib.tld --Again

2002-02-05 Thread Bob Williams

I am getting the message: Could not locate TLD META-INF/taglib.tld  when
trying to compile a project in Forte v3.  This problem has been reported
before and the solution suggested by Andy Noble doesn't seem to be working
for me.  I have the TLD's in WEB-INF directory and open the appropriate
TLD's before compiling as suggested, but still get the error message.

Anyone have an answer?

Bob Williams


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Thread Safety Question (was Formatting Dates, Integers...)

2002-02-05 Thread Jeff Martin

Any use of java.text.DateFormat (or its subclasses) format method is thread unsafe 
(quite to my surprise). The problem comes from DateFormat holding an instance of a 
Calendar to help it break the java.util.Date into pieces.

When a second thread calls format() while another thread is still in format(), it 
naturally starts poking the new month/day/etc into the [same!] calendar, overwriting 
what the first thread put there [and is still using]. It goes downhill from there. I 
got anything from garbled/mixed dates to NullPointerExceptions, depending on when and 
where the two threads were.

Jeff

-Original Message-
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 5:12 AM
To: Struts Users Mailing List
Subject: Thread Safety Question (was Formatting Dates, Integers...)


Do you know what the problem was that made your use of format objects non-thread safe?

> -Original Message-
> From: Jeff Martin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 5:56 PM
> To: Struts Users Mailing List
> Subject: RE: Formatting Dates, Integers...
> 
> 
> Be very careful about using DateFormatter's that way. I learned a hard
> lesson in a previous project that DateFormater (and even just the format
> method) is not thread safe.
> 
> Jeff
> 




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Changing ActionForms in an Action

2002-02-05 Thread Pavel Nejedly

On Tue, Feb 05, 2002 at 09:29:38AM -0700, Ace wrote:
# Can an Action class perform() forward a different ActionForm  to the 
# forwarded jsp
# than the one it receives?
 
  [...]

# (Yes I know the Action can stuff anything into 
# the session
# or request but this is kind of a non-standard way for a jsp to access 
# its form isn't it?).

  you can put the entire ActionForm into request attribute with the 
  same name you wrote in  in struts-config.xml
  
  You don't need to add any extra code in the JSP.
  
  struts-config:
  
  ...
  
  
  action:
  request.setAttribute ("myForm", new MyForm (name));

  jsp:
  

  


  Pavel

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Design question about ActionForm's validate method

2002-02-05 Thread Sid Stuart

Hi,

I've stumbled across a subtle problem/design question that I don't see
mentioned in the documentation.

The ActionForm's validate method can be configured to verify form data
from a page and generate error messages which may then be displayed on
the page for the user to see. This works fine when the user has accessed
the page by specifying a JSP file in the URL. When the user accesses the
page by calling the Action directly though, the validate method is
called before the user ever sees the page, much less inputs valid data
to the form. This leads to an unfortunate display of unwarranted error
messages.

It would be nice if the documentation would provide a rule such as:
If one plans on the user calling the Action directly in the URL  then
one should not use the automatic validation provided by ActionForm.

Further, as having two different procedures to generate a page can lead
to subtle errors, one should decide whether a page will be accessed as a
JSP or as an Action and design for the one scenario. The simplest (and
safest) design rule will be to access all pages through either one
mechanism or the other.

Comments?

Sid Stuart





  1   2   >