New Windows, Struts, IE 5 and sessions dying

2001-06-01 Thread Graeme Miller

Summary: Any known bugs and workarounds with Multiple Windows in IE5,
Servlet Sessions and Struts 1.0b1?

Detailed Version:

We are using Struts 1.0b1 and Tomcat J2EE form-based login security on our
website.  The user requests a protected page and is automatically redirected
by Tomcat to the login page from which they login and enter the site.  The
password and username gets stored in a session automatically by Tomcat for
use in further protected pages.  No problem there - it works perfectly.

However when we open a new window using the javascript functions
window.open(url), window.showModelessDialog(url) or
window.showModalDialog(url), things go badly wrong.  The moment the new
window is opened the user has to log in again in the main window before they
can do anything else.  Had a look at the HttpServletRequest and the the
j_username and j_password variables appear to be deleted from the session
attributes the moment you open the new window, but the cookie with the
session id still appears to be present.

After considerable effort we have narrowed the problem down to Struts
itself.  If we open the new window with a url that is just a static file
(html,gif etc) the session doesn't get lost.  If we open the new window with
a url that is a jsp file that doesn't involve struts once again everything
continues working fine.  But the moment we open the new window with a struts
url (ie *.do) the session gets lost in the main window.

Has anyone else had this problem?  Any known bugs in Struts 1.0b1 that we
should be aware of?  Any known solutions/workarounds?  Help! 

Thanks,
 
Graeme.



Re: New Windows, Struts, IE 5 and sessions dying

2001-06-01 Thread Jim Richards

At 07:04 PM 1/06/01 +1200, you wrote:
Summary: Any known bugs and workarounds with Multiple Windows in IE5,
Servlet Sessions and Struts 1.0b1?

A few things to note. Have a look to see if the redirect is forcing :80 (port 80)
onto the end of the URL, this can cause the session get lost in the ether.
Upgrade to struts-b2 and it'll go away.

Another thing to note is that on NT you can have each IE run in a separate process,
which gives it its own set of cookies, which will also loose the session value.

I think it's probably the first one though, as you'd be using html:rewrite / to 
generate
the URL for the javascript, and up until struts-b2 it would add the port into the 
address
and confuse the browser. This happens in Netscape Navigator as well.


--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html



RE: New installation - NoSuchMethodError

2001-06-01 Thread someil

I have the same config without Apache server and any problem!

How did U have install struts_example application on tomcat ?
Have U the same problem with other struts application ?

- cyril -


-Message d'origine-
De : Marcelo Romaniuc [mailto:[EMAIL PROTECTED]]
Envoye : vendredi 1 juin 2001 08:07
A : [EMAIL PROTECTED]
Objet : RE: New installation - NoSuchMethodError


I did so and the error is still there...

What struts.jar has to do with the error
messages... all of the messages refers to tomcat and
jasper classes, not struts?

Please, help me!!!


Thanks,



--- Vinod Shintre [EMAIL PROTECTED] wrote:
 point ur path/classpath to struts.jar if its not
 under root/lib
 usually u wd have it under ur
 webapps/WEB-INF/classes/lib

 hope that works
 vin




 -Original Message-
 From: Marcelo Romaniuc [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 3:05 PM
 To: [EMAIL PROTECTED]
 Subject: New installation - NoSuchMethodError


 Hi,


 I`ve just finished the installation of Struts
 1.0b2. I'm using Tomcat 3.2.1 and Apache.
 When I call /struts-example/logon.jsp I receive
 the following error back:
 Anyone has had such problem ? How to solve ?

 Thanks,

 Marcelo R. Romaniuc

 Location: /struts-example/logon.jsp
 Internal Servlet Error:

 javax.servlet.ServletException
   at

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
   at

javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
   at

org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
   at

org.apache.tomcat.core.Handler.service(Handler.java:286)
   at

org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
   at

org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
 7)
   at

org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
   at

org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
 (Ajp12ConnectionHandler.java:166)
   at

org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
   at

org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
   at java.lang.Thread.run(Thread.java:484)
 Root cause:

 java.lang.NoSuchMethodError
   at

org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfo
 Impl.java:524)
   at

org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoIm
 pl.java:432)
   at

org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.ja
 va:385)
   at

org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:233)
 at

org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
 ntListener.java:706)
 at

org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
 ener.java:116)
 at

org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
 at

org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
 at

org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
 at

org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
 at

org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
 at

org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
 at

org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
 at

org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
 rvlet.java:152)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
 va:164)
 at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at

javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
 at

org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at

org.apache.tomcat.core.Handler.service(Handler.java:286)
 at

org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at

org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
 7)
 at

org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at

org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
 (Ajp12ConnectionHandler.java:166)
 at

org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at

org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)


 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail -
 only $35
 a year!  http://personal.mail.yahoo.com/



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/




RE: Potential Security Flaw in Struts MVC

2001-06-01 Thread Jon.Ridgway

Hi Kumera,

If you want to check at the form level, have you considered using a custom
tag, such as the app:checkLogon tag used in the example app provided with
struts. It's perhaps not the best way as others have pointed out on this
list, but it seems to fit your requirements.

Jon.

-Original Message-
From: Jim Richards [mailto:[EMAIL PROTECTED]] 
Sent: 31 May 2001 09:21
To: [EMAIL PROTECTED]
Subject: Re: Potential Security Flaw in Struts MVC

At 11:53 PM 30/05/01 -0700, you wrote:
A good way of removing the bucketloads :-} from your Action classes is to
subclass ActionServlet and implement processActionPerform to do the logon
check.

It's not just for login though, that was the example I used, every action
that
generates a form needs to do this. Mostly it is checking against URL
hacking.



--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html



Tag Iterate !!!

2001-06-01 Thread Geoffrey Van Nuffelen

Hi all,

I try to use the tag iterate (logic) but I can't. I haven't success.

I am working on Windows NT with tomcat 3.2 and struts 1.0b-2.

I try to pass an array of object ( a personnal client class). but when a try
to access a property I have this error :

javax.servlet.ServletException: Cannot find bean client in scope null
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
 at
_0002fClientList_0002ejspClientList_jsp_55._jspService(_0002fClientList_0002
ejspClientList_jsp_55.java:214)

What I have to ?? I have to specify a scope ???

Here you are the code of the .jsp , java class wich put the parameter and
client.class.

.jsp :


...
body bgcolor=white

logic:iterate id=client name=test 
 bean:write name=client property=pmclient/
/logic:iterate

/body
...

Java class :
--

 Client test[] = clients.getClients();
 servlet.log(nmclient from clients :  + test[i].getNmclient(), 1); // test
... it's working

 HttpSession session = request.getSession();
 session.setAttribute(test, test);

 return (mapping.findForward(success));


Client class :


public class Client {
  private String nmclient = ;
  private String pmclient = ;
  private long cdclient;

  public Client() {
  }
  public String getNmclient() {
return nmclient;
  }
  public void setNmclient(String newNmclient) {
nmclient = newNmclient;
  }
  public String getPmclient() {
return pmclient;
  }
  public void setPmclient(String newPmclient) {
pmclient = newPmclient;
  }
  public long getCdclient() {
return cdclient;
  }
  public void setCdclient(long newCdclient) {
cdclient = newCdclient;
  }
}


Thanks in advance for your help.

Geoffrey...











Any body trying struts wit weblogic?

2001-06-01 Thread ameer



Hi i need help in using struts in weblogic .. pls anybody help
Ameer Hussain SSs/w engineerYashaa Infotech Pvt.Ltd.http://www.yashaa.com


RE: Any body trying struts wit weblogic?

2001-06-01 Thread Manoj Deb




What kind of help you want? 

Regards,
Manoj

-Original Message-From: ameer 
[mailto:[EMAIL PROTECTED]]Sent: Friday, June 01, 2001 3:37 
PMTo: StrutsSubject: Any body trying struts wit 
weblogic?
Hi i need help in using struts in weblogic .. pls anybody help
Ameer Hussain SSs/w engineerYashaa Infotech Pvt.Ltd.http://www.yashaa.com


RE: Tag Iterate !!!

2001-06-01 Thread A.Sharma


hi
probably change the case of 'c' in client.
the class has Capiltal 'c' while in JSP you are accessing small 'c'.

:)
ash

-Original Message-
From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:24 PM
To: Struts-User (E-Mail)
Subject: Tag Iterate !!!


Hi all,

I try to use the tag iterate (logic) but I can't. I haven't success.

I am working on Windows NT with tomcat 3.2 and struts 1.0b-2.

I try to pass an array of object ( a personnal client class). but when a try
to access a property I have this error :

javax.servlet.ServletException: Cannot find bean client in scope null
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
 at
_0002fClientList_0002ejspClientList_jsp_55._jspService(_0002fClientList_0002
ejspClientList_jsp_55.java:214)

What I have to ?? I have to specify a scope ???

Here you are the code of the .jsp , java class wich put the parameter and
client.class.

.jsp :


...
body bgcolor=white

logic:iterate id=client name=test 
 bean:write name=client property=pmclient/
/logic:iterate

/body
...

Java class :
--

 Client test[] = clients.getClients();
 servlet.log(nmclient from clients :  + test[i].getNmclient(), 1); // test
... it's working

 HttpSession session = request.getSession();
 session.setAttribute(test, test);

 return (mapping.findForward(success));


Client class :


public class Client {
  private String nmclient = ;
  private String pmclient = ;
  private long cdclient;

  public Client() {
  }
  public String getNmclient() {
return nmclient;
  }
  public void setNmclient(String newNmclient) {
nmclient = newNmclient;
  }
  public String getPmclient() {
return pmclient;
  }
  public void setPmclient(String newPmclient) {
pmclient = newPmclient;
  }
  public long getCdclient() {
return cdclient;
  }
  public void setCdclient(long newCdclient) {
cdclient = newCdclient;
  }
}


Thanks in advance for your help.

Geoffrey...












RE: Any body trying struts wit weblogic?

2001-06-01 Thread Firmin David

There have been many discussions, some quite recently, about setting up
Struts under various versions of weblogic. Take a look through the mailing
list archive to see if you can find what you're after there.
 
[EMAIL PROTECTED]/
http://www.mail-archive.com/struts-user@jakarta.apache.org/ 
 
HTH
Dave
 
-Original Message-
From: Manoj Deb [mailto:[EMAIL PROTECTED]]
Sent: 01 June 2001 11:01
To: [EMAIL PROTECTED]
Subject: RE: Any body trying struts wit weblogic?
 
What kind of help you want? 
 
Regards,
Manoj

-Original Message-
From: ameer [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:37 PM
To: Struts
Subject: Any body trying struts wit weblogic?


Hi i need help in using struts in weblogic .. pls anybody help
Ameer Hussain SS
s/w engineer
Yashaa Infotech Pvt.Ltd.
http://www.yashaa.com http://www.yashaa.com/ 

 


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




Re: Using Javascript to cancel submit?

2001-06-01 Thread Ted Husted

If you want the JavaScript to cancel the submit, you need to return
false somewhere.

Struts can also watch for these in the Action, either using the
isCancel() method, or by looking at the label of the button pressed. 

Struts doesn't write the HTML for tables, and could not affect the sizes
of your table rows, except to the extent that the browser adjusts the
row sizes to fit the instant data. 

The Struts custom tags (like all others) simply substitute standard HTML
for the custom tags on their way to the browser, and leaves everything
else alone. You can view the source to see what the browser sees. Struts
isn't otherwise involved in how your page renders. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/



Error when deploying to SilverStream application server

2001-06-01 Thread Jan Fredrik Øveraasen

Hi
When I deploy a war file to my app. server I get the following error
message:

 [exec] Catastrophic error: /jsp/accomodation_application_step2.jsp:
An unexpected fatal exception 'String index out of range: 0' occured.


In the jsp page I use the struts-html.tld tag lib and these are the tags
that I use:


1.  html:form action=accomodation_application_step2.do
2.  html:text property=fromday size=1 maxlength=2
styleClass=boxboligdato20/

3.  html:select property=nationality styleClass=boxboligsok254
  html:option value=valnull.../html:option
   /html:select

4.html:hidden property=submitter value=/

Thanks in advance

Jan Fredrik

___ Jan Fredrik Øveraasen | Senior Systems Developer 
___ Cell Network ASA | Pb. 5313, Sørkedalsv. 10A, N-0304 Oslo,
Norway
___ Tel: +47 23196600/35 | Fax: +47 23196601 | Mob: +47 93 49 99 88
   ___ http://www.cellnetwork.com/ |
mailto:[EMAIL PROTECTED]

 




Re: Any body trying struts wit weblogic?

2001-06-01 Thread Jonathan Asbell

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

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


 There have been many discussions, some quite recently, about setting up
 Struts under various versions of weblogic. Take a look through the mailing
 list archive to see if you can find what you're after there.

 [EMAIL PROTECTED]/
 http://www.mail-archive.com/struts-user@jakarta.apache.org/

 HTH
 Dave

 -Original Message-
 From: Manoj Deb [mailto:[EMAIL PROTECTED]]
 Sent: 01 June 2001 11:01
 To: [EMAIL PROTECTED]
 Subject: RE: Any body trying struts wit weblogic?

 What kind of help you want?

 Regards,
 Manoj

 -Original Message-
 From: ameer [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 3:37 PM
 To: Struts
 Subject: Any body trying struts wit weblogic?


 Hi i need help in using struts in weblogic .. pls anybody help
 Ameer Hussain SS
 s/w engineer
 Yashaa Infotech Pvt.Ltd.
 http://www.yashaa.com http://www.yashaa.com/



 
 The information in this email is confidential and is intended solely
 for the addressee(s).
 Access to this email by anyone else is unauthorised. If you are not
 an intended recipient, you must not read, use or disseminate the
 information contained in the email.
 Any views expressed in this message are those of the individual
 sender, except where the sender specifically states them to be
 the views of Capco.

 http://www.capco.com
 ***





RE: Error when deploying to SilverStream application server

2001-06-01 Thread Afzal, Tanver

Hi Jan,
when u r using these tag lib under silverstream donot comment the struts
tags using html style comments like 
!-- html:hidden property=submitter value=/
 --
this throw the index of range exception.

if it is not help full send me the whole code.

Thanks

Tanver







 -Original Message-
 From: Jan Fredrik Øveraasen [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 8:37 AM
 To:   STRUTS (E-mail)
 Subject:  Error when deploying to SilverStream application server
 
 Hi
 When I deploy a war file to my app. server I get the following error
 message:
 
  [exec] Catastrophic error:
 /jsp/accomodation_application_step2.jsp:
 An unexpected fatal exception 'String index out of range: 0' occured.
 
 
 In the jsp page I use the struts-html.tld tag lib and these are the tags
 that I use:
 
 
 1.html:form action=accomodation_application_step2.do
 2.html:text property=fromday size=1 maxlength=2
 styleClass=boxboligdato20/
 
 3.html:select property=nationality styleClass=boxboligsok254
   html:option
 value=valnull.../html:option
/html:select
 
 4.  html:hidden property=submitter value=/
 
 Thanks in advance
 
 Jan Fredrik
 
   ___ Jan Fredrik Øveraasen | Senior Systems Developer 
   ___ Cell Network ASA | Pb. 5313, Sørkedalsv. 10A, N-0304 Oslo,
 Norway
   ___ Tel: +47 23196600/35 | Fax: +47 23196601 | Mob: +47 93 49 99 88
___ http://www.cellnetwork.com/ |
 mailto:[EMAIL PROTECTED]
 
  



Re: Any body trying struts wit weblogic?

2001-06-01 Thread Chuck Amadi


Hi, well not with weblogic?, but anyway i would like to add im utilising
Netbeans v3.2 ( Jarkarta-tomcat-3.2.1 container) and i have experienced
problems with the internal web browser as with both struts apps
and ora apps i continually recieve the following error.
ora/ch5/userinfo1.jsp [2:0] Unable to open taglibrary /orataglib
: Could not locate TLD META-INF/taglib.tld Errors compiling
userin
Thus i have to use Netscape browser with means i not utilising
the full IDE and it's getting under my skin as i have tried a few suggestions
but no success.

note i have tried the linkage problems concerning orataglib.jar
and orataglib.tld
Thus i refer do the directive as % taglib uri ="/orataglib"
prefix="ora"%>
and eusured that web.xml is configured.
but to no avail. any suggestions welcomed- using struts now and always
excellent documentation and examples.



> ***
>

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal  rhoi gwybod i
ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi.



Re: Redirecting to secure server (ie from http:// to https://)

2001-06-01 Thread Ted Husted

This is still a very messy area. I ended hardcoding some strings in a
production application, but there solutions that would mitigate this, so
you only have to hardcode the scheme in your struts-config file. See 

To SSL and Back Again


http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01357.html


http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01361.html


http://www.mail-archive.com/struts-user@jakarta.apache.org/msg08028.html


http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07850.html


http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07796.html


http://www.mail-archive.com/struts-user@jakarta.apache.org/msg06454.html


We definatley need to document the best-practice for doing this, as soon
as we figure out what that is ;-)


Michael Mok wrote:
 
 To those who have done it
 
 Can you advice on how you manage to redirect the http request from http to
 https?
 
 I have following scenario (typical of a shopping site).
 
 1) User search and place item into shopping cart (eg calls
 http://www.acmeshop.com/addtoshoppingcart.do)
 2) addtoshoppingcart.do do some processing and redirects user back to
 shopping search page (eg http://www.acmeshop.com/shoppingsearch.jsp )
 3) User clicks on the check out page URL. (eg calls
 http://www.acmeshop.com/showshoppingcart.do and return the results to
 http://www.acmeshop.com/showcartcheckout.jsp).
 4) User clicks on make payment. On the shwowcartcheckout.jsp, I need to be
 able to set the form action attribute to call
 https://www.acmeshop.com/makepayment.do (where makepayment.do will redirect
 to the https://www.acmeshop.com/enterpaymentdetail.jsp). The form action
 attribute on the enterpaymentdetail.jsp will call
 https://www.acmeshop.com/processpayment.do )
 
 What I am trying to find out is how do I set the https:// in the form action
 attribute of showcartcheckout.jsp. The form tag does not have any attribute
 will will create the https://...  string. Do I have to hard code the form
 action in this page? Or am I total off the track?
 
 Thanks in advance
 
 Michael Mok

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/



RE: Any Hashmap examples used in jsp page?

2001-06-01 Thread Jon.Ridgway

Hi Dudley,

See code sample below. The type in the iterate tag must be as shown, you
will then need to use a bean define to put your 'value' into the page
context and cast it to whatever type you have placed in your HashMap value.

Hope this helps,

Jon.

logic:iterate id=list name=gallery property=artifacts
type=java.util.Map.Entry
 
  bean:define id=artifact name=list property=value
type=net.itwa.model.artifact.IArtifact/

  bean:write name=artifact property=description/ 
  
/logic:iterate


-Original Message-
From: Dudley Butt@i-Commerce [mailto:[EMAIL PROTECTED]] 
Sent: 01 June 2001 10:34
To: [EMAIL PROTECTED]
Subject: Any Hashmap examples used in jsp page?

Hi all, 

Could anyone please point me to where i can find some examples using
hashmaps in a jsp with struts...
Instead of using a whole bunch of logic equal tags all the time, i need a
way to evaluate a collection, looking for a specific key value, then show or
hide the relevant input boxes on my jsp..
any help...please!!!???



Re: Proposed feature: Bean property transformations

2001-06-01 Thread Ted Husted

What I'm missing is a comprehensive, general package for converting data
types and formatting properties for presentation. Most of this
functionality is available somewhere in java and javax space, but it's
spread around.

What would be most useful, I think, is a single, generic package that
provided

(1) validation of Strings using regular expressions (a la David
Winterfeldt's servlet), with direct support for native and JDBC
datatypes,

(2) binary to String and String to binary conversions for all native and
standard types, and support for adding others,

(3) given a formatting specification (00#.##) and data of any
supported type, return a formatted presentation String, 

(4) support for locale-senstive transformations with (3),

(5) support for extending the formatting specification for unusual
circumstances, and

(6) provide simple date-calculation methods and a countdown presentation
format (seconds, minutes, hours, or days from now until then).

We could then use this helper object during the validation cycle to
convert incoming Strings to the other types needed by business-logic
objects, AND pass through the functionality from a bean:writeTransform
 tag, that could pull a property from a given bean, transform it, and return a 
formatted String for direct use by the view. 

If there is not something like this already out there, I've very
interested in getting started on this package, since I really, really
need it for my own projects. Could be a nice addition to the Commons ... 

I'm cross-posting this to Struts user in case someone can suggest a
package that already provides this functionality.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


Ron Smith wrote:
 
 I've been thinking of implementing this feature lately and I haven't
 seen it proposed on this list yet.  Any comments?
 
 Summary:
 Provide a means to flexibly plug in transformations that could
 be applied to JavaBean properties for presentation in a JSP page.
 What transformation to apply to which JavaBean property
 is specified in the Struts JSP tags (e.g. bean:write).
 Transformations are Java classes that are responsible for taking
 a JavaBean property or any other Object, applying whatever
 transformation, and returning the transformed Object for
 presentation in a JSP page.
 Some example transformations are to format a date in a specific
 format, format decimal numbers, or even to sort a collection in
 a particular order before iterating over the collection's objects.
 
 Motivation:
 Separating business entity code from presentation-specific code
 is a good thing.  Consider a business entity class called Order.  If
 we want to display the orderPlacedDate attribute in 4 different
 date formats on a JSP page, we could add 4 different methods to
 the Order class to support these 4 different formats.  But we quickly
 end up with a very cluttered Order class and the Order class is too
 coupled to the presentation details.
 One approach I've used is to create presentation wrapper classes
 which hold references to the business entity objects and are
 responsible for all of the presentation specific formatting.  The
 JSP pages access the presentation wrapper classes and not the business
 entity classes.  For sites that access many different business entity
 classes, this can become very tedious.
 A better approach would be to be able to plug-in specific types of
 presentation transformations to be applied to specific JavaBean
 properties that are to be displayed in a JSP page without having to
 create unecessary wrapper classes.
 
 Details:
 Transformations are coded in transformation classes, all of which
 implement
 a Transformation interface.  This interface has one public method:
 Object transform(Object inObj)
 This method is responsible for applying whatever transformation is
 needed
 to the passed in object and returning a transformed version of the
 object for presentation in a JSP page.
 The transformation objects would be created at initialization based on
 the
 configuration file, and could be initialized with some parameters from
 the
 configuration file (e.g. the date format string to be used for a date
 transformation).  Each transformation has a name associated with it, and
 is
 registered in a hash table based on the name.
 
 Some of the Struts custom JSP tags would be modified to take an
 additional
 transformation parameter which indicates what transformation is to be
 applied.  For example:
bean:write name=order property=orderPlacedDate
  transformation=shortDateFormat/
 In the above example, the orderPlacedDate property is retrieved
 from the order bean, then the Transformation named shortDateFormat
 is looked up in the transformations registry, and applied to the
 property.  Whatever was returned by the transformation is what gets
 displayed on the web page.
 
 Another benefit is that because the 

Re: New installation - NoSuchMethodError

2001-06-01 Thread Chuck Amadi

Hi, i was in the same whirlpool and guess what i am still in there albeit i only
had that problem with netbeans v3.2 internal browser and when i utilised
netscape with that logon example ( no problem blemo )   ;^ }.

I have now gone on 2 better examples and things so if u got any suggestions mail
it

cheers chuck

Vinod Shintre wrote:

 point ur path/classpath to struts.jar if its not under root/lib
 usually u wd have it under ur webapps/WEB-INF/classes/lib

 hope that works
 vin

 -Original Message-
 From: Marcelo Romaniuc [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 3:05 PM
 To: [EMAIL PROTECTED]
 Subject: New installation - NoSuchMethodError

 Hi,

 I`ve just finished the installation of Struts
 1.0b2. I'm using Tomcat 3.2.1 and Apache.
 When I call /struts-example/logon.jsp I receive
 the following error back:
 Anyone has had such problem ? How to solve ?

 Thanks,

 Marcelo R. Romaniuc

 Location: /struts-example/logon.jsp
 Internal Servlet Error:

 javax.servlet.ServletException
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
 at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at
 org.apache.tomcat.core.Handler.service(Handler.java:286)
 at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
 org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
 7)
 at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
 (Ajp12ConnectionHandler.java:166)
 at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
 Root cause:

 java.lang.NoSuchMethodError
 at
 org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfo
 Impl.java:524)
 at
 org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoIm
 pl.java:432)
 at
 org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.ja
 va:385)
 at
 org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:233)
 at
 org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
 ntListener.java:706)
 at
 org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
 ener.java:116)
 at
 org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
 at
 org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
 at
 org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
 at
 org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
 at
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
 at
 org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
 at
 org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
 at
 org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
 rvlet.java:152)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
 va:164)
 at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
 at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at
 org.apache.tomcat.core.Handler.service(Handler.java:286)
 at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
 org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
 7)
 at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
 (Ajp12ConnectionHandler.java:166)
 at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn 

RE: template and I18N

2001-06-01 Thread Holman, Cal

Gregor

This works


template:put name='title' direct='true'
bean:message key='app.login' /
/template:put

or


template:put name='title' direct='true' content='bean:message
key='app.login'/'/



Cal

-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 09:02
To: [EMAIL PROTECTED]
Subject: Re: template and I18N

Johan Compagner [EMAIL PROTECTED] writes:


 look at the bean:message tag:

 bean:message key=title/

 johan

Hi Johan,

this does not help me. bean:message key=title / prints
the internationalized word Title. But I want to use it in
the template to print various titles.


Example (without the headers):

ApplicationResources.properties
===

app.login=Login
app.logout=Logout

ApplicationResources_de.properties
==

app.login=Anmelden
app.logout=Abmelden


now the template files:

template.jsp


...
headtitletemplate:get name=title //title/head
...


login.jsp
=

template:insert template='/template.jsp'
  template:put name='title' content='Login' direct='true'/
  ...
/template:insert


logout.jsp
==

template:insert template='/template.jsp'
  template:put name='title' content='Logout' direct='true'/
  ...
/template:insert


As you can see, I have to insert the words Login and Logout
into the files login.jsp and logout.jsp literally, instead of
inserting the keys app.login and app.logout


Of course I could use the scripplet approach and use


template:put name='title'
  content='%= resources.getMessage(locale, app.login) %'
  direct='true' /

instead. But is there a nicer way?

Something like:

template:put name='title' direct='true'
bean:message key='app.login' /
/template:put


Groetjes

--
gR




RE: Resources clarification - is there a work around

2001-06-01 Thread Deadman, Hal

Let me preface this by saying I haven't given this much thought. Since
struts already supports multiple bundles (i.e. with the bundle attribute on
bean:message) would it make since to have struts read all the resource files
from a particular directory or path and use the base filename of the
property file as the name of the bundle? That would allow people to break up
their properties files however they want to. The default file with the
bundle key Action.MESSAGES_KEY would still be used whenever a bundle was not
specified.

I think if I were going to have a huge number of bundles like one per page,
I would pull my resources from a database using a custom
DatabaseMessageResourceFactory. I have considered writing a such a factory
and the accompanying webapp to maintain the translations but I haven't
followed through.

Hal

 -Original Message-
 From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 9:30 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Resources clarification - is there a work around


 The problem we found was that a master list is impossible to
 manage.  For
 instance, on the soon to arrive 10th page of the property
 file, you will
 have to search all of the previous pages to check to see if
 you already used
 the property name already.  Chances are that you did use the
 name already
 because an individual tends to think in their own way and
 come up with the
 same naming schemes, and you will have more for the property
 name name in
 many many other pages.  Then some designer or manager tells
 you to add a
 form field which you recognize that you could use name as the field
 property and realize you have to rethink the way you have
 been and will
 continue naming things, such as signup_name, logon_name,
 search_name,
 artist_name, publication_name..  after completeing
 the 30th jsp page
 you say to yourself,  man(sigh), if I just had a properties
 file for each
 page or include, than I wouldnt have a 3000 line properties
 file with which
 I cannot sort, group, or categorize all of the property names nicely.

 It was easier for us to:
 1) know what was on any page (just look at the like named
 proerties file)
 2) fix or add to a page without thinking if the name was
 used, and whether I
 thus have to come up with a naming scheme for this one or all of them.
 3) just hand over translatable content to the translators on
 a page by page
 basis.
 4) if you later decide to keep it in the database you can
 because you just
 associate pageName with propertyName

 logon.jspuser.name
 logon.jspuser.address
 logon.jsp
 signup.jspuser.name
 signup.jspuser.password
 checkout.jspuser.name

 This is much easier.  Try it.  You will see how managing this
 grand list
 sucks ;^)

 If your developers are anything like places I have worked
 for, than you know
 how things
 get out of control.  I just take this as a given.  With my
 way, at any time,
 I can email out new pages and text  to be translated (by a
 clerk, designers,
 editors).  I send a visual and typeographic pair of items
 that go together
 and that an editor can say, yes, this is what I want the
 caption to say on
 this page.  Do I repeadedly send the editor chunks of a
 3000+ item list and
 then say:
 (me) can you tell me what you want to say in these new lines
 of text?
 (editor) which lines?
 (me)  the ones I highlighted
 (editor) which of these lines of text is on this page we are talking
 about?.

 Do you see why I say the benefits from a big list loose out
 to a small list?
 What if I delete one.  What pages does it effect? Which ones
 have been left
 orphaned?  You dont know in any easy way.  For search and
 replace you now
 have to search each particularly named item.  If they all were called
 user.name I could just search and replace it everywhere
 below a directory.
 If one is logon.user.name and another search.user.name
 you now have to
 search and find each unique one. Could you get them all, or
 did you miss
 some because someone was using logon.User.Name instead of
 logon.user.name or logonUserName.

 - Original Message -
 From: Nanduri, Amarnath [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, May 31, 2001 5:50 PM
 Subject: RE: Resources clarification - is there a work around


  Hi Guys,
 
  From my personal experience it would not be a bad
 idea for struts
 to
  support multiple resource bundles. I will explain my reasons below.
 
  At present struts has one resource bundle in which you can
 include error
  messages , confirmation messages , labels on html fileds
 etc For a big
  application ( like i am on right now. We are going to have
  50 jsp pages
  minimum) it is quite a pain in the neck to add properties
 to a single
 file.
  Besides the developers having to compete with one another
 to checkout the
  properties file ( from source safe ) maintaining it is an
 another pain.
 
 One more problem we encountered is nested exceptions
 deep in the 

Re: Resources clarification - is there a work around

2001-06-01 Thread Jonathan

I totally respect what you are trying to do with the database idea, but the
problem with managing and keeping track keeps re-appearing - that is, if you
are suggesting getting the data from a database.  In fact, now you have
added another series of steps:
what variables do we have, where are we using them, lets now go do a search
in the database to see what we have, lets now see where we use it.
It's like working with database normalization.  You first normalize, then
you de-normailze to eliminate complexity.  In this case I will always need
to know what text appears on what page.  If they are bundled together than
it is a matter of finding the associated text file for that page.  Otherwise
I have to go hunting and querying.  Want to add a page?  Add a text file.
Want to change an item on a page?  Change it in all the associated text
files (one for each language translation).  Yes you cant make a global
change.  But you CAN do a global search and replace!


- Original Message -
From: Deadman, Hal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 12:18 PM
Subject: RE: Resources clarification - is there a work around


 Let me preface this by saying I haven't given this much thought. Since
 struts already supports multiple bundles (i.e. with the bundle attribute
on
 bean:message) would it make since to have struts read all the resource
files
 from a particular directory or path and use the base filename of the
 property file as the name of the bundle? That would allow people to break
up
 their properties files however they want to. The default file with the
 bundle key Action.MESSAGES_KEY would still be used whenever a bundle was
not
 specified.

 I think if I were going to have a huge number of bundles like one per
page,
 I would pull my resources from a database using a custom
 DatabaseMessageResourceFactory. I have considered writing a such a factory
 and the accompanying webapp to maintain the translations but I haven't
 followed through.

 Hal

  -Original Message-
  From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, May 31, 2001 9:30 PM
  To: [EMAIL PROTECTED]
  Subject: Re: Resources clarification - is there a work around
 
 
  The problem we found was that a master list is impossible to
  manage.  For
  instance, on the soon to arrive 10th page of the property
  file, you will
  have to search all of the previous pages to check to see if
  you already used
  the property name already.  Chances are that you did use the
  name already
  because an individual tends to think in their own way and
  come up with the
  same naming schemes, and you will have more for the property
  name name in
  many many other pages.  Then some designer or manager tells
  you to add a
  form field which you recognize that you could use name as the field
  property and realize you have to rethink the way you have
  been and will
  continue naming things, such as signup_name, logon_name,
  search_name,
  artist_name, publication_name..  after completeing
  the 30th jsp page
  you say to yourself,  man(sigh), if I just had a properties
  file for each
  page or include, than I wouldnt have a 3000 line properties
  file with which
  I cannot sort, group, or categorize all of the property names nicely.
 
  It was easier for us to:
  1) know what was on any page (just look at the like named
  proerties file)
  2) fix or add to a page without thinking if the name was
  used, and whether I
  thus have to come up with a naming scheme for this one or all of them.
  3) just hand over translatable content to the translators on
  a page by page
  basis.
  4) if you later decide to keep it in the database you can
  because you just
  associate pageName with propertyName
 
  logon.jspuser.name
  logon.jspuser.address
  logon.jsp
  signup.jspuser.name
  signup.jspuser.password
  checkout.jspuser.name
 
  This is much easier.  Try it.  You will see how managing this
  grand list
  sucks ;^)
 
  If your developers are anything like places I have worked
  for, than you know
  how things
  get out of control.  I just take this as a given.  With my
  way, at any time,
  I can email out new pages and text  to be translated (by a
  clerk, designers,
  editors).  I send a visual and typeographic pair of items
  that go together
  and that an editor can say, yes, this is what I want the
  caption to say on
  this page.  Do I repeadedly send the editor chunks of a
  3000+ item list and
  then say:
  (me) can you tell me what you want to say in these new lines
  of text?
  (editor) which lines?
  (me)  the ones I highlighted
  (editor) which of these lines of text is on this page we are talking
  about?.
 
  Do you see why I say the benefits from a big list loose out
  to a small list?
  What if I delete one.  What pages does it effect? Which ones
  have been left
  orphaned?  You dont know in any easy way.  For search and
  replace you now
  have to search each particularly 

RE: Tag Iterate !!!

2001-06-01 Thread Deadman, Hal

Based on what you are showing in your email, everything looks OK. I don't
think the problem is with the iterate tag. The message
javax.servlet.ServletException: Cannot find bean client in scope null
would have to be coming from bean:write which is looking for a bean called
client. It's looking in all scopes (null just means you didn't specify a
scope), so you don't need to add a scope. The iterate tag should put a bean
in the page scope with the name client.

Are you sure that it is the bean:write tag inside the iterate tag that is
causing the error or is there something else on the JSP that you aren't
showing? Try removing the bean:write from the iterate tag and replacing it
with some html.

 -Original Message-
 From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 9:49 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Tag Iterate !!!


 Hi Ash,

 Thanks for your help... But I have the same error with Client.

 Have you got a example of this tag method ???

 Geoffrey...
 - Original Message -
 From: A.Sharma [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 01, 2001 12:10 PM
 Subject: RE: Tag Iterate !!!


 
  hi
  probably change the case of 'c' in client.
  the class has Capiltal 'c' while in JSP you are accessing small 'c'.
 
  :)
  ash
 
  -Original Message-
  From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 3:24 PM
  To: Struts-User (E-Mail)
  Subject: Tag Iterate !!!
 
 
  Hi all,
 
  I try to use the tag iterate (logic) but I can't. I haven't success.
 
  I am working on Windows NT with tomcat 3.2 and struts 1.0b-2.
 
  I try to pass an array of object ( a personnal client
 class). but when a
 try
  to access a property I have this error :
 
  javax.servlet.ServletException: Cannot find bean client in
 scope null
   at
 
 org.apache.jasper.runtime.PageContextImpl.handlePageException(
 PageContextImp
  l.java:459)
   at
 
 _0002fClientList_0002ejspClientList_jsp_55._jspService(_0002fC
 lientList_0002
  ejspClientList_jsp_55.java:214)
 
  What I have to ?? I have to specify a scope ???
 
  Here you are the code of the .jsp , java class wich put the
 parameter and
  client.class.
 
  .jsp :
  
 
  ...
  body bgcolor=white
 
  logic:iterate id=client name=test 
   bean:write name=client property=pmclient/
  /logic:iterate
 
  /body
  ...
 
  Java class :
  --
 
   Client test[] = clients.getClients();
   servlet.log(nmclient from clients :  +
 test[i].getNmclient(), 1); //
 test
  ... it's working
 
   HttpSession session = request.getSession();
   session.setAttribute(test, test);
 
   return (mapping.findForward(success));
 
 
  Client class :
  
 
  public class Client {
private String nmclient = ;
private String pmclient = ;
private long cdclient;
 
public Client() {
}
public String getNmclient() {
  return nmclient;
}
public void setNmclient(String newNmclient) {
  nmclient = newNmclient;
}
public String getPmclient() {
  return pmclient;
}
public void setPmclient(String newPmclient) {
  pmclient = newPmclient;
}
public long getCdclient() {
  return cdclient;
}
public void setCdclient(long newCdclient) {
  cdclient = newCdclient;
}
  }
 
 
  Thanks in advance for your help.
 
  Geoffrey...
 
 
 
 
 
 
 
 
 




CTLX Dreamweaver Extension Error

2001-06-01 Thread Luna, Kat
Title: CTLX Dreamweaver Extension Error





Hi,


Has anyone encountered a Tomcat:SecurityException when running the ctlx Extension for Dreamweaver? The Floater displays the list of tld's, but onClick() of useTaglibs.html throws the following exception while trying to load the array of taglibs.

java.lang.SecurityException: sealing violation
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
 at TLDParser.parseTLD(TLDParser.java:150)
 at TLDParser.doGet(TLDParser.java:132)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
 at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)


Any suggestions would be appreciated...


Kat Luna
Web Developer,
BCE Emergis
[EMAIL PROTECTED] 





Templates

2001-06-01 Thread Jose Manuel Sanchez Pineda

Hi everybody, i`m new here...

I worked whit strut's templates in Resin, always used forwards into
pages than include the template, now need put this work into weblogic
but get this:

java.lang.IllegalStateException: Cannot forward a response that is
already commi
tted

i don't know if this is a bug for weblogic or for resin,

How i can use this work in Weblogic.

Thanks in advanced

P.D. Sorry for my very bad english




RE: Templates

2001-06-01 Thread Jason Chaffee
Title: RE: Templates





It is a bug with Weblogic. Weblogic probaly already sent newline charaters in the response, so it won't allow you to forward the request at that point. I recommend you keep the generated java file when the jsp is compiled and you will be able to see what Weblogic is doing.

-Original Message-
From: Jose Manuel Sanchez Pineda [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 12:23 PM
To: [EMAIL PROTECTED]
Subject: Templates



Hi everybody, i`m new here...


I worked whit strut's templates in Resin, always used forwards into
pages than include the template, now need put this work into weblogic
but get this:


java.lang.IllegalStateException: Cannot forward a response that is
already commi
tted


i don't know if this is a bug for weblogic or for resin,


How i can use this work in Weblogic.


Thanks in advanced


P.D. Sorry for my very bad english





Size on html:file tag??

2001-06-01 Thread dhay



Hi everyone.

I am using the html:file tag, and running up against an error, saying the size
attribute is invalid!  It is clearly marked as valid in the docs!

Is this a bug?  I can take off the size= and it displays fine.

My tag looks like this:  html:file property=filename size=60/.

Help is appreciated,

Dave






RE: Size on html:file tag??

2001-06-01 Thread Deadman, Hal

If your looking at the documentation on the web, it may be newer than your
build. I think the size tag was added to the tld recently. Do you have a
recent build?

Hal

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 3:30 PM
 To: [EMAIL PROTECTED]
 Subject: Size on html:file tag??




 Hi everyone.

 I am using the html:file tag, and running up against an
 error, saying the size
 attribute is invalid!  It is clearly marked as valid in the docs!

 Is this a bug?  I can take off the size= and it displays fine.

 My tag looks like this:  html:file property=filename size=60/.

 Help is appreciated,

 Dave






Re: Potential Security Flaw in Struts MVC

2001-06-01 Thread RAdams2472


 please remove me from this list.


Re: Proposed feature: Bean property transformations

2001-06-01 Thread Ted Husted

Harris, Andrew S wrote:
 A component would be able to hold a text value and a data value. The text
 value could hold the value entered by the user, prior to validation, then
 this could be played back to the user if validation failed on that
 component. If validation succeeded, the data value would be updated, then
 the text value would be replaced by the formatted value, using the data
 value and the formatter.

This is a good design pattern, and one we can use with Struts today. In
the ActionForm bean, define two properties, one for the text value and
one for the data value. If validation succeeds, convert the text value
to the data value, and (optionally) update the text value to match your
preferred formatting. 

Though, with a general conversion/transformation package, we would
really only need to store the desired data value since we could
transform it again later when the value was accessed for presentation,
perhaps via a bean:writeTransform tag.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/



RE: Multipage forms and validation

2001-06-01 Thread Niall Pemberton

David,

I see your on the 1.1 ToDo list as a volunteer for Standard Validations
and Client Side Validations - is it likely your validation framework is
going to be adopted for Struts - and if so how close is what you're offering
now to what Struts will have in 1.1?

I'm just wondering whether to plough on with what we've got or wait for what
might be coming in Struts.

Niall


 -Original Message-
 From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
 Sent: 31 May 2001 23:32
 To: [EMAIL PROTECTED]
 Subject: Re: Multipage forms and validation


 I've done some work on a validation framework for
 Struts that is based on defining rules in an xml file.
  Right now it depends on associating a field with a
 page and setting a variable in the JSP page to set
 what page you are on.  I had a long discussion with
 someone on how to make it not depend on associating
 fields with a page so it was separated from the view,
 but I haven't had time to finish doing that.  The
 biggest problem is that if you have a session scope
 bean then you still absolutely have to know if there
 is a checkbox field on the page so you can reset it.
 The best idea to get away from page numbers was to
 have a custom ActionForward for each page and pass in
 the checkbox fields to be reset along with the action.

 Here is the url for what I currenty have working.
 There is a multi-page example in the validator.war and
 jdbc-validator.war in the webapps directory.

 http://home.earthlink.net/~dwinterfeldt

 David Winterfeldt

 --- Lukasz Kowalczyk [EMAIL PROTECTED] wrote:
  Hi.
 
  I'm trying to employ Struts to help me build
  multi-page forms.
  Those forms consist of all kinds of inputs,
  including multipart.
 
  The questions are as follows:
 
  1. How can I validate forms which I know will never
  set all of the
  required elements at a time since the required
  elements can span multiple
  pages? I could check which submit was clicked and
  then validate just a
  subset of form elements but I think it's not very
  Struts-oriented, and
  secondly this makes validate() method dependent on
  specific placement of
  form inputs (when I decide to move some field to
  another page I have to
  modify validate()).
 
  2. Can I use the same Action class to handle
  multipart and non-multipart
  request? Will performance hurt because of this?
 
  --
  £ukasz Kowalczyk
 


 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/





nested TokenStreamException, WL6, Templates

2001-06-01 Thread Jonathan



the 
Exception

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


the page 
"logon.jsp"

%@ include file="inc/imports.jsp" 
%template:insert 
template='/inc/template2.jsp'template:put name='title' 
content='Logon to Success Meetings' direct='true'/template:put 
name='logon_form' 
content='/inc/logon_form.jsp'//template:insert



the template 
"my_template.jsp"

%@ include file="inc/imports.jsp" 
%html:html locale="true" 
BODY
  
template:get name='logon_form'/
  
.
 
/BODY/html:html



Common include 
"imports.jsp"

%@ page language="java" %%@ taglib 
uri="/WEB-INF/struts-bean.tld" prefix="bean" %%@ taglib 
uri="/WEB-INF/struts-html.tld" prefix="html" %%@ taglib 
uri="/WEB-INF/struts-logic.tld" prefix="logic" %%@ taglib 
uri="/WEB-INF/struts-template.tld" prefix="template" 
%


RE: Any Hashmap examples used in jsp page?

2001-06-01 Thread Steve A Drake

 Hi Jon. I'm having a similar problem as Dudley with a HashMap. I tried
playing around with your example but couldn't get it to work within the
context of what I'm doing. Perhaps another example would help. For
example, I have a scriptlet that looks something like:

 fee.fie.fo.sql.ResultSetBean rsb =
(fee.fie.fo.sql.ResultSetBean) request.getAttribute(resultBean);
 java.util.HashMap hm = rsb.getProperties();
 String foobar = (String) hm.get(foobar);
 out.println(foobar =  + foobar);


So, the ResultSetBean contains a HashMap as a property. I get a reference
to the HashMap and then can extract a value with a key as input. Any ideas
on the syntax of doing this with bean tags? TIA.



On Fri, 1 Jun 2001, Jon.Ridgway wrote:

 Hi Dudley,

 See code sample below. The type in the iterate tag must be as shown, you
 will then need to use a bean define to put your 'value' into the page
 context and cast it to whatever type you have placed in your HashMap value.

 Hope this helps,

 Jon.

 logic:iterate id=list name=gallery property=artifacts
 type=java.util.Map.Entry

 bean:define id=artifact name=list property=value
 type=net.itwa.model.artifact.IArtifact/

 bean:write name=artifact property=description/

 /logic:iterate


 -Original Message-
 From: Dudley Butt@i-Commerce [mailto:[EMAIL PROTECTED]]
 Sent: 01 June 2001 10:34
 To: [EMAIL PROTECTED]
 Subject: Any Hashmap examples used in jsp page?

 Hi all,

 Could anyone please point me to where i can find some examples using
 hashmaps in a jsp with struts...
 Instead of using a whole bunch of logic equal tags all the time, i need a
 way to evaluate a collection, looking for a specific key value, then show or
 hide the relevant input boxes on my jsp..
 any help...please!!!???


---
Steve Drake[EMAIL PROTECTED]
UCAR / COMET   (303) 497 - 8496
PO Box 3000
Boulder, CO  80307-3000





error in tag library ImageTag using weblogic 5.1

2001-06-01 Thread Zaremba, Don


I'm getting the following error trying to use struts with WL5.1
Anyone seen this before?

weblogic.servlet.jsp.JspException: (line -1): Error in tag library at:
'form': The Tag class 'org.apache.struts.taglib.html.ImageTag' has no setter
method  corresponding to TLD declared attribute 'path', (JSP 1.1 spec,
5.4.1)

thanks

don

don zaremba
Ellacoya Networks
603 577-5544 ext-247



RE: error in tag library ImageTag using weblogic 5.1

2001-06-01 Thread Abraham Kang

Which build are you using?

--Abraham

 -Original Message-
 From: Zaremba, Don [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 4:21 PM
 To: '[EMAIL PROTECTED]'
 Subject: error in tag library ImageTag using weblogic 5.1
 
 
 
 I'm getting the following error trying to use struts with WL5.1
 Anyone seen this before?
 
 weblogic.servlet.jsp.JspException: (line -1): Error in tag library at:
 'form': The Tag class 'org.apache.struts.taglib.html.ImageTag' 
 has no setter
 method  corresponding to TLD declared attribute 'path', (JSP 1.1 spec,
 5.4.1)
 
 thanks
 
 don
 
 don zaremba
 Ellacoya Networks
 603 577-5544 ext-247
 



RE: error in tag library ImageTag using weblogic 5.1

2001-06-01 Thread Abraham Kang

Don,

Can you try the 1.0-b2 I think there were some tag issues in certain builds
of
1.0b1.

--Abraham

 -Original Message-
 From: Zaremba, Don [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 4:53 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: error in tag library ImageTag using weblogic 5.1



 Its 1.0-b1



 -Original Message-
 From: Abraham Kang [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 01, 2001 8:04 PM
 To: [EMAIL PROTECTED]
 Subject: RE: error in tag library ImageTag using weblogic 5.1


 Which build are you using?

 --Abraham

  -Original Message-
  From: Zaremba, Don [mailto:[EMAIL PROTECTED]]
  Sent: Friday, June 01, 2001 4:21 PM
  To: '[EMAIL PROTECTED]'
  Subject: error in tag library ImageTag using weblogic 5.1
 
 
 
  I'm getting the following error trying to use struts with WL5.1
  Anyone seen this before?
 
  weblogic.servlet.jsp.JspException: (line -1): Error in tag library at:
  'form': The Tag class 'org.apache.struts.taglib.html.ImageTag'
  has no setter
  method  corresponding to TLD declared attribute 'path', (JSP 1.1 spec,
  5.4.1)
 
  thanks
 
  don
 
  don zaremba
  Ellacoya Networks
  603 577-5544 ext-247
 





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

2001-06-01 Thread Jonathan Asbell

the Exception

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


the page logon.jsp

%@ include file=inc/imports.jsp %
template:insert template='/inc/template2.jsp'
 template:put name='title' content='Logon to Success Meetings'
direct='true'/
 template:put name='logon_form' content='/inc/logon_form.jsp'/
/template:insert



the template my_template.jsp

%@ include file=inc/imports.jsp %
html:html locale=true
BODY
template:get name='logon_form'/
.
/BODY
/html:html



Common include imports.jsp

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


 Template pages can take longer to compile, since there is more to do,
 but should run fine after that.

 I've used complex templates extensively with other containers and have
 no runtime performance problems.

 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel 716 737-3463.
 -- http://www.husted.com/about/struts/

  Jonathan wrote:
 
  I am using weblogic 6 on w2k.  I clicked on a templated page and
  MAN.I wait atleast 1 minute for the results.  Is this known?





Re: Initialization of Request-Scoped Objects

2001-06-01 Thread Craig R. McClanahan



On Thu, 10 May 2001, Jeff Trent wrote:

 When myAction.do is called, I have a chance within reset() to
 initialize my request-scoped objects.  However, if myAction.jsp is
 called instead then I can't seem to find a way to get initialized.  
 Are there any methods called in my Action class when the .jsp file is
 invoked instead of the .do file?
 
 

Currently, the only methods that are called are the zero-arguments
constructor and the setServlet() method.  What I tend to do is put a call
to reset() inside the constructor for things like this.

Craig





Re: possibility of default action?

2001-06-01 Thread Craig R. McClanahan



On 11 May 2001 [EMAIL PROTECTED] wrote:

 Is it possible to specify a default action for forms that? Say the only
 behaviour I need is that the parameters in the Form object are populated and
 validated.
 
 Possible? Desirable?
 

How would Struts know what page to forward (or redirect) to next?

Craig




Re: Problem with tag

2001-06-01 Thread Craig R. McClanahan



On Fri, 11 May 2001, Laurent Cornelis wrote:

 I found a workaround, I wrote :
 
 logic:iterate id=faq name=faqList type=be.dummy.faq.bean.FAQBean/
 p
  html:link page='/listFAQ.do' anchor='%=
 ((FAQBean)pageContext.findAttribute(faq)).getId().toString() %'
   bean:write name=faq property=question/
  /html:link
 /p
 /logic:iterate
 
 But I really don't like this solution ...
 

The reason this is necessary is that you are not allowed to next a tag
inside a tag (the way that you originally tried to do).

 Any cleaner solution will be grealty appreciated !
 

I'm not sure there is a better solution off the top of my head ...

Craig




RE: How can i execute the STRUTS examples in JavaWebServer?

2001-06-01 Thread Craig R. McClanahan



On Fri, 11 May 2001, Anthony Martin wrote:

 I would be interested in knowing if anyone has done this.  I work with a
 group that started with JWS, and their move to Tomcat doesn't seem to be
 going very well.  I would still like to supply them with Struts objects, but
 only to prove it can work in strange contexts like JWS.
 

I didn't think JWS supported Servlet 2.2 + JSP 1.1, which Struts requires
...

 
 Anthony
 

Craig




Re: filtering unwanted characters

2001-06-01 Thread Craig R. McClanahan



On Fri, 11 May 2001, Ian Kallen [EMAIL PROTECTED] wrote:

 
 Apache 2.0 supports input filters, how about writing one that cleans the
 data input before mod_jk/mod_webapp can hand it off to Tomcat?
 

In a Servlet 2.3 environment (such as Tomcat 4.0), you can use the new
Filter APIs to accomplish the same thing.

However, either of these approaches means you have to parse out the
request parameters and put them back together again for the
real servlet.  That sounds like a lot more work than should be needed.

 On Fri, 11 May 2001, Nanduri, Amarnath wrote:  I am looking for some
 open source code that deals with filtering  technology. Basically i
 want to filter any unwanted characters from the user  input data. The
 user might try to pass in some SQL quesries or try to run  some shell
 scripts or put special characters which might be rejected by a 
 database (or even corrupt it). If no such open source code is
 available then  i want to write something like that. I was wondering
 if anyone has done some
 

Have you considered putting stuff like this in the validate() method of
your form bean?  You could probably write a common utility method that
scanned a String for unwanted characters, returning true if there was a
problem.  Then, your validate() method would pass all the input strings in
the form through this method to look for problems.

The other thing that really really helps when doing database stuff is to
use JDBC PreparedStatement objects.  That way, even if your users try to
pass in wierd command delimiters and stuff, it ends up inside an SQL
string that is properly quoted by the driver itself, rather than modifying
the SQL command you are trying to run.

 cheers,
 -Ian
 
 --
 Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
 
 

Craig





Weblogic and ClassCastException

2001-06-01 Thread Steven Leija



Hey All,

Has anyone experienced ClassCastException problems 
while using WebLogic 6.0?

I'm developing a multipage form and when trying to 
retreive the bean from the request, I'm getting a 
ClassCastException.

Steven

BEGIN:VCARD
VERSION:2.1
N:Leija;Steven;R.
FN:Steven R. Leija
ORG:Valtech Technologies, Inc.;Professional Services
TITLE:Consultant
NOTE;ENCODING=QUOTED-PRINTABLE:=0D=0A  =0D=0A
TEL;WORK;VOICE:(214) 792-3585
TEL;HOME;VOICE:(972) 820-5627
TEL;CELL;VOICE:(806) 535-3227
TEL;WORK;FAX:(972) 789-1340
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;5080 Spectrum Drive=0D=0ASuite 1010 West;Dallas;Texas;75001;United States =
of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:5080 Spectrum Drive=0D=0ASuite 1010 West=0D=0ADallas, Texas 75001=0D=0AUnite=
d States of America
ADR;HOME;ENCODING=QUOTED-PRINTABLE:;;3653 Briargrove Lane=0D=0AApt. #1531;Dallas;TX;75287;United States of Amer=
ica
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:3653 Briargrove Lane=0D=0AApt. #1531=0D=0ADallas, TX 75287=0D=0AUnited State=
s of America
URL;HOME:http://management.ba.ttu.edu/stevenleija.htm
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20010602T014909Z
END:VCARD



Re: How can I use set-property property=foo value=123 / instru ts-config.xml

2001-06-01 Thread Craig R. McClanahan



On Fri, 11 May 2001, David Holland wrote:

 How can I use set-property property=foo value=123 / in
 struts-config.xml ?
 
 I want to use it in place of forward to store Action configuration info
 (set-property is
 specified in the dtd).
 
 Tried to add getter  setter to Action descendant - but assignment by
 introspection 
 didn't seem to work. 
 
 Looked at the source for ActionServlet, and the digester class does appear
 to be doing something
 with this property, although it looks like it is only looking for a single
 instance in an action.
 
 As far as I can tell, either it is not intended for general use or it is
 broken.
 
 Any thoughts?
 
 David Holland
 [EMAIL PROTECTED]
 
 
The basic idea is that you might want to subclass ActionMapping (the
Struts class that holds the information related to an action element) to
add some additional properties.  We still want to take advantage of the
automatic property setting that Digester does for you, but it is not
convenient to change the DTD for the configuration file for each
individual application requirement.

So, to support customizable property setting, the following steps are
required:

(1) You must create a subclass of ActionMapping with extra property
getter and setter functions for your custom properties:

  public MyActionMapping extends ActionMapping {
  public String getFoo() { ... }
  public void setFoo(String foo) { ... }
  }

(2) You must tell Struts to use your MyActionMapping class (instead of
the standard one when it processes the struts-config.xml file.  You
can do this globally for all action elements by setting up the
mapping servlet initialization parameter for the controller servlet:

  servlet
servlet-nameController/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
... other init parameters ...
init-param
  param-namemapping/param-name
  param-valuecom.mycompany.mypackage.MyActionMapping/param-value
/init-param
  /servlet

or you can override the class to be used on each individual action:

  action ...
   className=com.mycompany.mypackage.MyActionMapping ... /

(3) Now, in your struts-config.xml file, you can customize the value of
foo for each individual action element.  Assuming you did the
global naming alternative, you might have something like this:

  action path=/bar
  type=com.mycompany.mypackage.BarAction
set-property property=foo value=Custom Foo Value/
  /action

(4) To retrieve the custom configuration values inside your action,
you will need to cast the ActionMapping you receive to your own
value:

  public ActionForward perform(ActionMapping mapping, ...) ... {
MyActionMapping myMapping = (MyActionMapping) mapping;
String foo = myMapping.getFoo();
...
  }

The same basic design pattern lets you customize the implementation
objects for forward and form-bean declarations as well, by extending
ActionForward and ActionFormBean respectively.

Craig McClanahan





Re: Global forwards, targets and frames

2001-06-01 Thread Craig R. McClanahan



On Fri, 11 May 2001, Kyle Robinson wrote:

 Is there a way to specify the target of a global forward?
 I have a global forward which I want to go to another frame.  For instance
 in my action if everything works fine I want to return to the input page but
 if there is an error I want to go to another frame.  Any thoughts?
  

Unfortunately, targets need to be specified by the client, not the
server.  For any one request, then, you're stuck with making a single
choice for where the response will be displayed.

  
  
 Kyle Robinson 
 Systems Consultant 
 Pangaea Systems Inc. 
 (250) 360-0111 
  
 

Craig





Re: filtering unwanted characters

2001-06-01 Thread Jonathan Asbell

See the character filter I donated last week

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




 On Fri, 11 May 2001, Ian Kallen [EMAIL PROTECTED] wrote:

 
  Apache 2.0 supports input filters, how about writing one that cleans the
  data input before mod_jk/mod_webapp can hand it off to Tomcat?
 

 In a Servlet 2.3 environment (such as Tomcat 4.0), you can use the new
 Filter APIs to accomplish the same thing.

 However, either of these approaches means you have to parse out the
 request parameters and put them back together again for the
 real servlet.  That sounds like a lot more work than should be needed.

  On Fri, 11 May 2001, Nanduri, Amarnath wrote:  I am looking for some
  open source code that deals with filtering  technology. Basically i
  want to filter any unwanted characters from the user  input data. The
  user might try to pass in some SQL quesries or try to run  some shell
  scripts or put special characters which might be rejected by a 
  database (or even corrupt it). If no such open source code is
  available then  i want to write something like that. I was wondering
  if anyone has done some
 

 Have you considered putting stuff like this in the validate() method of
 your form bean?  You could probably write a common utility method that
 scanned a String for unwanted characters, returning true if there was a
 problem.  Then, your validate() method would pass all the input strings in
 the form through this method to look for problems.

 The other thing that really really helps when doing database stuff is to
 use JDBC PreparedStatement objects.  That way, even if your users try to
 pass in wierd command delimiters and stuff, it ends up inside an SQL
 string that is properly quoted by the driver itself, rather than modifying
 the SQL command you are trying to run.

  cheers,
  -Ian
 
  --
  Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
 
 

 Craig






Re: Accessing ServletContext from session object

2001-06-01 Thread Craig R. McClanahan

On Fri, 11 May 2001, Matthew Fowkes wrote:

 I was wondering if anyone else has tried to access the ServletContext from
 the session object.  I have written a class that implements
 HttpSessionBindingListener so I can detect when a users session expires.
 When the session expires, the valueUnbound method is called and is passed an
 event.  From that event I can retrieve the users session object and this is
 where the problem begins.  The only object I have is the users session
 object, but I need to somehow get an attribute from the ServletContext to
 mark that the user session has expired.  Has anyone on the list done this
 before?
 
 Thanks in advance.
 
 Matt
 

In a Servlet 2.3 container (like Tomcat 4.0), you can do this pretty
easily -- a getServletContext() method was recently added to the
HttpSession API for exactly this sort of thing.

In a Servlet 2.2 environment, however, the easiest way is probably to
store a reference to the servlet context in your listener object when it's
first created (i.e. before you add it as a session attribute).  That way,
it can reference the servlet context object in the valueBound() and
valueUnbound() methods.

Craig McClanahan





Re: Where are the TLD's?

2001-06-01 Thread Craig R. McClanahan



On Mon, 14 May 2001, Johan Compagner wrote:

 hmmm
 
 that's why i don't get them, i don't use the build process.
 I use VAJ so i just import all the java files to get a complete build.
 
 I shall download the binary and src then
 

Note that the generated TLD files *are* in the binary distribution, in the
lib directory.

 johan
 

Craig




Re: What is a good design or idea or utility to create a cachecollection of N number of elements Least Recently Used?

2001-06-01 Thread Craig R. McClanahan



On Sat, 12 May 2001, Vic Cekvenich wrote:

 What is a good design or idea or utility to create a cache collection
 of N number of elements Least Recently Used?
 
 Say a hash map with synchronized get and put, that would track LRU and
 lock at the element level? Must be of fixed size and work at element
 level.
 
 Suggestion please and thanks in advance for any comments.

 Vic
 

There is some work going on in the Jakarta Commons project to define a
nice reusable cache API for this sort of thing.  It hasn't gotten as far
as real live code yet, but that shouldn't be too far away.  I'd subscribe
to the jakarta-commons mailing list to keep track of what's going on
there.

As a general note, a bunch of the general purpose Struts utility
components (like BeanUtils and the Digester) are being migrated over to
Commons because they are generally useful - a future version of Struts
will use the Commons versions instead of the ones currently in
org.apache.struts.util.

Craig





Re: 2 newbie questions..

2001-06-01 Thread Craig R. McClanahan



On Sat, 12 May 2001, Roy Truelove wrote:

 Hey guys,
 
 Quick questions from a newbie.. When the mapping is local to a
 particular action, the Action class should call findForward on the mapping
 that's passed in.  But if the mapping is a global one, it should call
 findForward on the instance of ActionServlet (called servlet) that is passed
 down from the parent Action class.  Is this correct?  Or does the
 ActionMapping that's passed in to the perform() method already contain the
 global mappings?  The reason I ask if because I really don't like the idea
 of having access (and having to use) member variables of a parent class.  It
 makes my OO alarms go off.  The example Struts application uses the
 servlet object, instead of the ActionMapping instance.
 

If you call findForward() on the mapping, the implementation will search
first in the local definitions, and then in the global definitions,
without you having to worry about it.  Thus, your Action can always call
mapping.findForward() and not worry about where it's defined.

 Second question has to do with subclassing an ActionMapping class.  As I
 understand it right now, the default ActionMapping class that is passed into
 the perform() method is created using the configuration XML file.  It
 contains the local mappings that are defined in the action tag for this
 path (as well as the global mappings?)  This seems to make sense, but in the
 example application, there is a subclass of ActionMapping calling
 ApplicationMapping, with some get / set methods. I can't find where this
 class is used in the application, nor an explaination of it in the
 walk-through or the user-guide.

This class isn't used any more because the standard ActionMapping has
everything that the example app needed.  (I should remove that class to
avoid confusion).  However, earlier this evening I wrote a fairly length
HOWTO response on how to customize ActionMappings to add parameters that
are configured in the struts-config.xml file.  This is a very convenient
way to pass configuration information to an Action.

 
 Thanks in advance for your help.  I'm trying to fully understand the example
 app before trying struts on my own, and these are a few of my hangups.
 
 Take it easy,
 Roy
 
 
Craig





Re: I18n, xslt and struts...

2001-06-01 Thread Craig R. McClanahan



On Mon, 14 May 2001 [EMAIL PROTECTED] wrote:

 
 Would it be feasible to place struts-specific tags into an xslt (for
 example bean:message key=foo/)?  In other words, is there any way to
 process the jsp code that the xslt returns?  I'm trying to do this from the
 context of a custom tag (so it's the custom tag that receives the jsp code
 from the xslt) but I'm not familiar if there is any kind of JspReader that
 processes the jsp code and returns a string.
 
 Any advice is greatly appreciated, Thank you,
 
 Dallas
 
 
 

As tempting as a scenario like this sounds, it doesn't really fit the
model of how JSP pages work.

The problem is one of timing -- the custom tags that Struts (or any other
custom tag library, for that matter) uses are translated at *compile* time
into equivalent Java code, in a servlet.  What you're asking to be able to
do is dynamically create JSP code at *runtime* and then somehow interpret
it, which doesn't really work.

The new servlet 2.3 and JSP 1.2 specs will make it somewhat easier to do
these sorts of things, but most people cannot take advantage of those
facilities yet.

Craig McClanahan





Re: Hidding .jsp files

2001-06-01 Thread Craig R. McClanahan



On Tue, 15 May 2001, Mikkel Bruun wrote:

 Hi Guys,
 
 Is it possible to make some sort of virtual path, enabling one to hide the
 actual .jsp pages???
 
 Example,
 
 i want to avoid a link like /logon/logonform.jsp
 replacing it with perhaps /logon (which in turn will point to
 /logon/logonform.jsp)
 
 I tried looking at the globalforwards, but i find the documentation quite
 lacking (there's an error in the code, btw)...but is this how its done???
 
 Another solution would be to make empty action classes that just returns
 the succes mapping, but that would be going over the top imho...
 
 
 Can anybody give an answer???
 
 thanks
 Mikkel Bruun
 
 
 

One thing to keep in mind is that, in a typical Struts application, the
names of the JSP pages are obscured anyway -- because the form submits go
to the controller servlet.  For example, walk your way through the Struts
example application, and note how many of the locations actually shown
have *.do extensions on them ...

As a more radical way to hide things (but more for the purpose of
discouraging users from setting bookmarks in the middle of an
application), I've also resorted on occasion to more radical approaches:

* Open the application in a window that doesn't have a location bar

* Create a frameset with only one frame in it (so the location bar
  never changes at all).

Craig McClanahan





Re: thread-safe?

2001-06-01 Thread Craig R. McClanahan



On Fri, 18 May 2001, Chris Butler wrote:

 heya folks,
 
 been noticing some errors in our logs when people double-click
 on buttons and other struts-related html elements.  are there
 any issues with it being thread-safe?  is there something that
 i should be doing with my Actions?
 
 any tips or related info would be great.  i'm using the 1.0b1
 build and haven't used any builds post that date.
 

Your actions *definitely* must be programmed in a thread-safe manner,
because there will be only one instance per action element.  Therefore,
if two or more requests (from the same user or different users) for the
same action at once, you have the potential for conflicts.

The most important rule is to not use any instance variables in your
Actions to store per-user information (it's OK to use them for global
information that is shared across all users).

 Chris

Craig





Re: bootstrapping in struts?

2001-06-01 Thread Craig R. McClanahan



On Fri, 18 May 2001, derek harding wrote:

 I am wondering if there is a way to include a bootstrap class using
 struts.  I know the web.xml is able to load a servlet on startup.  
 But is this the only way to load classes on startup?
 

If you want stuff executed when the application is started, this is the
only way that is portable across all servlet containers.

In a servlet 2.3 environment (such as Tomcat 4.0), there is a new feature
called application event listeners that serve this purpose without having
to be servlets themselves.

 Thanks,
 Derek
 

Craig





Re: Jakarta-tomcat and struts configuration

2001-06-01 Thread Craig R. McClanahan



On Mon, 21 May 2001, Moore, Amy L wrote:

 I have some questions and was hoping someone might be able to assist me. I
 am trying to configure struts with jakarta-tomcat 3.2.1 on my local machine.
 My tomcat.bat file is configured to read all of the .jar files from one
 location, which I assume is standard. I was wondering if I could do the same
 with my .tld files. I am not sure it is good or bad practice to have all of
 your .tdl files in one central location... but my thought process for doing
 so would be so that I can have a repository for all tdl files vs. having
 them in each application's web-inf directory. 
 
 If this makes sense to implement... what reserved word or variable in
 Jakarta if any do I use to set the path correctly? Or is this handled in the
 web.xml file for each application?
 

The mechanism for installing an application onto Tomcat is to place the
WAR file (such as struts-example.war) into the webapps directory of
Tomcat, and then restart it -- no other configuration is required.

When developing your own applications, it is important to understand the
requird directory structure, which is described in the Servlet
Specification that you can download from

  http://java.sun.com/products/servlet/download.html

You might also want to read the Application Developer's Guide that comes
with Tomcat for general instructions on setting up web apps.

 Any help is appreciated.
 
 a
 

Craig





Re: wrong property descriptor returned (#1843)

2001-06-01 Thread Craig R. McClanahan



On Mon, 21 May 2001, Young, Wayne wrote:

 I just submitted bug #1843. 
 
 If you have a class MyClass for which a MyClassBeanInfo class ONLY
 EXISTS IN ANOTHER PACKAGE, then the incorrect beaninfo  hence property
 descriptors are returned.
 
 This causes the properties in MyClass to be skipped during population from
 the request. This was a difficult bug to find.
 
 The workaround is to rename the MyClass class to something that won't
 conflict OR create a MyClassBeanInfo class in the same package to describe
 the bean.
 

This resolution of this issue was actually a little more subtle than that.

The set of other packages that the bean introspection code looks in is
actually configurable via a call to
Introspector.setBeanInfoSearchPath().  By default, the only package on the
search path is called sun.beans.infos.  And (at least in JDK 1.3.1), the
only class in this package is a class called ComponentBeanInfo -- which
is where Wayne ran into problems -- because he wanted to call his bean
class Component.

The solution to this is to do one of two things:
* Call Introspector.setBeanInfoSearchPath() to set some other search path
  than the standard.
* Name your bean anything othe than Component.java.

 Thanks.
 
 Wayne
 [EMAIL PROTECTED]
 
 
 

Craig





Re: Getting Base deployment directory (Tomcat)

2001-06-01 Thread Craig R. McClanahan



On Mon, 21 May 2001, Jeff Trent wrote:

 Quick Tomcat question:  How can I retrieve the base deploy directory
 name so that I can use absolute URL paths to my action forms within an
 HREF?
 

What you're really after is request.getContextPath().  This is the prefix
to all of the request URIs that belong to your web app.  Struts takes care
of figuring that out for you in many of it's custom tags -- for example:

  html:link page=/menu.jspClick me/html:link

in an application installed on context path /foo will generate

  a href=/foo/menu.jspClick me/a

 Thanks,
 Jeff
 
 

Craig





RE: tool for the struts-config.xml

2001-06-01 Thread Craig R. McClanahan



On Wed, 23 May 2001, Gogineni, Pratima wrote:

 Hi,
 
 This could be done similar to the way they serialize the user database xml
 file in the struts example but this is what I saw under the changes and bug
 fixes section of the struts example application:
 
 Removed any attempt to save the pseudo-database at application shutdown,
 because there is no portable mechanism to accomplish this task. 
 
 a. does anyone know why the mechanism is not portable?
 b. if above is true we will face the same problem when you try to serialize
 the struts-config.xml file? 
 

The serialization part wasn't the problem.  The challenge is that there is
no portable way to *write* to a static resource within your web
application.  For example, you cannot assume that your webapp is running
from an unpacked directory -- it's quite possible to run from a WAR file
directly, or from some other structure (I understand that Oracle deploys
static resources as BLOB objects in the database).

Now, a development tool for creating struts-config.xml files would not
have this limitation, because you'd just let the user tell you the
filename under which it should be saved.

 pratima
 

Craig


 -Original Message-
 From: Mikkel Bruun
 To: '[EMAIL PROTECTED]'
 Sent: 5/23/01 12:56 AM
 Subject: SV: tool for the struts-config.xml
 
 It wouldnt be too hard, considering the already implemented admin
 actions...
 
 Give it a try!!!
 
 Mikkel
 
 -Oprindelig meddelelse-
 Fra: Alexander Jesse [mailto:[EMAIL PROTECTED]]
 Sendt: 23 May 2001 09:55
 Til: struts-user
 Emne: RE: tool for the struts-config.xml
 
 
 Hi,
 
 somehow that would make a nice and usefull demo-app (a web-app using
 struts to setup the config-struts.xml)
 
 Maybe when I have some time...(too much ideas and too less time)
 
 Alexander
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 23, 2001 7:11 AM
 To: [EMAIL PROTECTED]
 Subject: Re: tool for the struts-config.xml
 
 
 
 Hi Lorena
 
 You could use XMLSpy to show and edit xml-Files and their dtd.
 
 regards
 
 Mike
 
 
 
 
 
 LORENA MASSIMO [EMAIL PROTECTED] on 22.05.2001 14:45:28
 
 Please respond to [EMAIL PROTECTED]
 
 To:   '[EMAIL PROTECTED]'
 [EMAIL PROTECTED]
 cc:
 Subject:  tool for the struts-config.xml
 
 
 
 
 Hi
 does anybody know if exists a tool (better if visual) to manage the
 struts-config.xml file?
 
 thanks Max
 
 
 
 
 




Re: Forums???

2001-06-01 Thread Craig R. McClanahan



On Tue, 22 May 2001, Spencer Smith wrote:

 This email list server is kind of weak in terms of threads and discussion.
 
 Should be moved over to a Forums.  I built a really good robust one.   If I
 get some requests, I can implement it and host it for free.
 
 Anyone interested in moving this over to a Forums?
 
 

Email list servers don't have anything to do with threads -- intelligent
mail readers do.  It's trivially simple to set up a mail client like
Netscape Communicator or Outlook Express to filter incoming messages for
each mail list into a separate folder, and then set the sorting sequence
to threaded.

In addition, switching to forums (as in NNTP) would disenfranchise a large
number of subscribers who are behind firewalls that prevent newsgroup
access.

Craig





Re: New ActionMapping Class

2001-06-01 Thread Craig R. McClanahan



On Tue, 22 May 2001, Michael Binette wrote:

 I created a new GenericActionMapping class that extends ActionMapping.  I
 added one property, processAction with public getter and setter methods for
 it.
 
 I then set the mapping property in web.xml for the struts Action servlet to
 my new GenericActionMapping class.  The log when I run TomCat correctly
 shows it using my new GenericActionMapping class.
 
 But, if I add processAction=whatever to my struts-config.xml, within the
 action element, I get a SAXParseException, Attribute processAction is
 not declared for element action.
 

This error happens because your struts-config.xml document now violates
the DTD.

 How do I get this to work?
 

That's what the set-property element is for:

action path=... ...
  set-property property=processAction value=yadda yadda/
/action

This little trick lets you extend the syntax of an ActionMapping, and add
new configurable properties, without having to modify the DTD.

 --
 Thanks,
 Michael Binette
 
 

Craig McClanahan





Re: digester and whitespace in XML text body

2001-06-01 Thread Craig R. McClanahan



On Wed, 23 May 2001, Nick Afshartous wrote:

 
 Hi,
 
 I'm using the digester to process the nested content in
 XML tags and am noticing that the leading/trailing whitespace
 doesn't seem to be removed as advertised in the doc.  
 

Hmm.

You're correct that the whitespace isn't being trimmed.  I also agree that
this would be generally useful -- although there may be some apps that
prefer to keep it.  However, could you point me at where in the docs we
advertise that this is supposed to be done?  (If we say so, then it's just
a bug that needs to be fixed -- otherwise, we'll probably need a way to
configure the desired behavior).

Craig




Re: digester and whitespace in XML text body

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, Mark Simms wrote:

 I believe the digester must be rewritten to support the JAXP 1.1 specs.

It's already been done in the Jakarta Commons version of Digester.  Struts
will switch to this at some point *after* 1.0 final -- the advertised XML
parser requirement for Struts 1.0 says JAXP 1.0 or better.

 wow, almost everything in digester is now deprecated...

That's because I marked the entire class as deprecated because of the
above.  Don't worry too much about it though:
* These classes will remain until well after 1.0 final is released
* The functionality will be the same (other than the switch to the
  JAXP/1.1 minimum for the parser), so the only thing you will need
  to change in your source code is the import statement.

Craig




Re: Non-matching extension tags

2001-06-01 Thread Craig R. McClanahan



On Wed, 23 May 2001, Steven Leija wrote:

 Hello All,
 
 Can anyone help me with this problem?  I'm trying to have a link open
 up a custom browser window using a struts html:link tag, but I'm
 getting a Non-matching extension tags error.  Here is my code:
 
 html:link href=window.open(/title.do + ?MOVIEID=%=MOVIEID%,
 title, fullscreen=no, toolbar=no, status=no, menubar=no,
 scrollbars=no, resizable=no, directories=no, location=no, width=550,
 height=350, left=200, top=200)%=TITLE%/html:link
 

Your problem is that the parser can't figure out which quotation marks are
which, since you're using them both around and within the href
attribute.  Try switching to single quotes
(href='window.open...') instead.

 Thanks in advance!  
 
 Have a good one.
 
 Steven
 

Craig





RE: struts framework without its TAG LIBRARIES in jsp pages how?

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, Sanjay Melinamani wrote:

 but my question is how? If we use HTML, how is the ActionForm gets
 delegated to Action::perform() method? 
 I guess we have to explicitly use the ActionForm bean and call its set
 methods...I am not sure about this !
 

Automatic form bean population happens when a request is received by the
controller servlet.  It doesn't matter what kind of a client created the
request -- it just looks like a URI with a bunch of parameters.  So, in
your HTML, just create a form with input fields in the usual way, and
the Struts controller servlet will be happy.

You will have probably to emulate some of the other functionality of the
Struts custom tags (like redisplaying the old values from a form bean) if
you don't want to use the tags from struts-html.tld -- but you can
certainly do so if you want to.

 If u suggest me as how is the ActionForm will be delegated to the
 Action::perfom method, that would be great !
 
 thanx
 sanjay
 

Craig McClanahan




RE: dynamic button names

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, Deadman, Hal wrote:

 It looks like this was broken in a recent update. The ButtonTag.java needs a
 doAfterBody() method in order to set the text instance variable to the body
 content. That will make it work like the SubmitTag.java. You should submit
 this as a bug on Bugzilla. http://nagoya.apache.org/bugzilla/ If you can't
 do that, let me know and I will do it.
 

This was just reported in Bugzilla, and has been fixed in tonight's
nightly build.  It will also be fixed in the 1.0 final release.

Craig




Re: How do you use templare user roles

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, Neil Blue wrote:

 Hello,
 
 I am looking at strut templates, and I am confused as to how you can set 
 the users role in a template. There does not see to be any way to set 
 the current user role, but there does seem to be ways to test it. Please 
 could anyone help.
 

The user role being tested is the value returned by
request.isUserInRole().  In turn, this is useful only if you are using
container-managed security as described in the Servlet Specification at

  http://java.sun.com/products/servlet/download.html

If you are coming to JavaOne next week, I will be hosting a BOF on
Thursday night specifically to discuss authentication and access control:

  BOF #1291:  Approaches to User Authentication and Access Control
  in Web Applications (Thursday 06/07, 7:00pm)

I'll make the slides available afterwards for those who cannot attend.


 Thank you
 Neil Blue
 
 

Craig





RE: Using tags from Java code

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, Young, Wayne wrote:

 We put reusable functionality in utility classes and call those from the
 custom tag.
 

In fact, many of the Struts tags themselves are designed like
this.  For example, nearly every tag that deals with beans and properties
ends up calling methods on BeanUtils and PropertyUtils.

The challenge with John's original question (can we create a tag runner
outside of a JSP page) is actually pretty important, when you consider the
issue of how to unit test JSP custom tags.  The hard part is that there is
a very large amount of context that you have to set up to make a custom
tag run -- you end up almost having to provide the runtime environment of
a servlet container to fully test these things :-(

 Wayne
 [EMAIL PROTECTED]

Craig McClanahan




RE: tricky mapping

2001-06-01 Thread Craig R. McClanahan



On Thu, 24 May 2001, John Schroeder wrote:

 Yuri,
 
 I have run into something similar with Excel files, but I'm not sure if it
 will address your current issue.
 
 My problem: when users run a report, return to them an Excel worksheet
 instead of HTML.
 Our particular approach used JSP's to easily handle the formatting of the
 Excel doc, but you by no means would need to do so.  You just need to set
 the proper Content-type and Content-disposition headers.
 
 %@page contentType=application/vnd.ms-excel%
 % response.setHeader(Content-disposition, inline;
 filename\myreport.xls\); %
 
 Now when a user chooses to save the file, the default name is myreport.xls,
 and the content returned is of the proper MIME-type.
 
 Hope this helps!
 
 --John
 

Like John, I've used the Content-disposition header for some cases like
this -- as long as the browser pays attention, it works like a charm.

For browsers that don't work correctly with it, though, there's still a
strategy for getting the effect Yuriy was after (the prompted filename is
the right thing).  It goes like this:

* Map the Struts controller servlet to a path
  pattern (/execute/*) instead of an extension (*.do).

* This means that a typical action request might
  be something like /execute/showAttachment instead
  of /showAttachment.do.

* Now, path mappings let you do something that
  extension mappings don't -- you can add extra path
  information after the part that selects the action,
  so you can say something like:
/execute/showAttachment/1.txt
  and your /showAttachment action will still get
  executed.

* When the user goes to save this request, the default
  filename will be 1.txt.

Craig McClanahan


 
 
 
 -Original Message-
 From: Yuriy Zubarev [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 24, 2001 12:33 PM
 To: [EMAIL PROTECTED]
 Subject: tricky mapping
 
 
 Hello everyone,
 
 I'm not quite sure that my question is truly struts-related,
 but since I'm developing a web-application using struts as a framework,
 I decided to post it here.
 
 A little proem. I'm in the middle of developing a web-mail facility
 and I've come to the point where I have to display mails' attachments.
 In general everything is fine except one minor but annoying thing.
 When a user double-clicks on a attachment link and selects
 Save target as..., a browser presents Save as dialog and offers
 a default name for requested object which looks like EmailPart,
 because the syntax of the link is as following:
 
 http://domain-name/EmailPart.do?part=1;
 
 I know the name of the requested attachment file in advance but I don't
 know how to fit it into the URL so that a browser can offer that
 name instead of EmailPart.
 
 On yahoo web-mail a link that points to attachment looks like this:
 
 http://yahoo_address/ym/ShowLetter/Account%5fmonitor%5fwork%5fflow.doc?box=
 InboxMsgId=1915_4666388_102413_741_67881_0bodyPart=2filename=Account%5fmo
 nitor%5fwork%5fflow.docdownload=1YY=2060order=downsort=datepos=0
 
 Bearing in mind this syntax I tried to make my link looks like:
 
 ...domain-name/EmailPart/File_name.ext?part=1
 
 And of course I failed, because the server (tomcat) treated
 EmailPart as a directory (I assume so) but not as action.
 
 So I would like to ask if anyone came across this problem
 and found a solution. Any suggestions would be highly
 appreciated.
 
 
 Thank you for your time.
 
 Best of luck,
 Yuriy Zubarev
 
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/
 




Re: Setting a user role

2001-06-01 Thread Craig R. McClanahan



On Fri, 25 May 2001, Jon.Ridgway wrote:

 Hi All,
 
 Is it possible to programmatically set a users role for use with
 request.isUserInRole (role). I would like to do this so I can started
 using the role based templating, without having to dig into app/web server
 specific security features.
 
 Any help much appreciated.
 
 Jon.
 

No, the values returned by isUserInRole() -- along with
getRemoteUser() and getUserPrincipal() -- are set by the servlet container
when you are using container-managed security.

Craig McClanahan





Re: Removing session-scoped form from the session

2001-06-01 Thread Craig R. McClanahan



On Fri, 25 May 2001, Fabien Modoux wrote:

 I would like to know how I can remove a session-scoped form
 from the current session once I don't need it anymore. Is it
 stored in the session under the form-bean.name attribute in
 the struts-config.xml file? If yes, removing the form from
 the session makes it available for other requests directly?
 

Yes, it's stored under the name value you list, so just call:

  session.removeAttribute(formbeanname);

to remove a bean named formbeanname.

 Thanks,
 
 -Fabien Modoux
 

Craig




Re: Mutiple logical struts-config.xml and ApplicationResource property files.

2001-06-01 Thread Craig R. McClanahan



On Fri, 25 May 2001, Bauer, John wrote:

 
 We are contemplating creating a brandable web application that will have
 customized navigation, templates, color schemes, etc. based on the role of
 the user.  We would like to use struts to make this happen.
 
 It seems like we might want to have multiple struts-config.xml and
 ApplicationResource property files for each user category/role to facilitate
 this.  Is this possible with struts, and how would you reference the proper
 configurations at run-time given the user role?
 

Running multiple controllers in the same webapp is a highly requested
feature, and it will be on the list of enhancements for Struts 1.1.

 Thanks,
 John Bauer
 

Craig McClanahan




Re: I want to override some struts classes

2001-06-01 Thread Craig R. McClanahan



On Fri, 25 May 2001, Jonathan wrote:

 Hello.  I am placing more debugging in the struts source files and I
 want these new classes to override the ones in the struts.jar
 
 I have placed the edited ActionServlet class in the
 WEB-INF/classes/org/struts/action/ directory. It should be working
 right?  Its not.  I also have 2 war files deployed as per the
 instructions on installing struts.  Are they interfering.  What should
 I be doing?
 
 I am using weblogic 6 on solaris
 

In the servlet 2.3 specification (which Tomcat 4.0 supports), the
container is *required* to make sure that a class in WEB-INF/classes will
override a class of the same name inside a JAR file in WEB-INF/lib, so
what you are describing would work there.

However, WebLogic 6 implements the servlet 2.2 spec, where this
requirement doesn't exist, so whether or not it works is dependent on how
they decided to implement their class loader.

Craig






Re: About Japanized web page of Struts

2001-06-01 Thread Craig R. McClanahan



On Mon, 28 May 2001, Ted Husted wrote:

 As long as all the copyright notices are kept in place, and you are
 contributing this work to the Apache Software Foundation, then this
 would be fine Toshi. 
 
 We appreciate your help!
 

Definitely!

And, once you have the URLs of the Japanese translations available, I'd be
happy to add them to the Struts Documentation (and to the Struts web
site).

 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel 716 737-3463.
 -- http://www.husted.com/about/struts/
 

Craig McClanahan


  Hello, Dear everyone.
  
  I'm Toshi Tabata who is a system engineer of
  Japanese company called Sun Japan.
  Nice to see you.
  
  I would like to have a permission from you
  about publishing Japanized web page of Struts.
  
  Since this April, I have started translating your web page,
  Struts project to Japanese.
  It's finished excepting some pages.
  (e.g. Tag library Guide, Old document...)
  
  Using that translation, I would like to introduce Struts
  for Japanese how its use has great effort for
  making applications.
  
  I'm planning that I would like to leave the un-translated
  part as in English, which keep links to original.
  
  If you will accept this proposal, I will publish Japanized
  Struts web page as soon as possible, and announce to you where
  I published.
  
  If there is any trouble about this plan, or any questions,
  Please let me know.
  
  I'm looking forward hearing from you.
  
  Thank you.
  
  Best Regards,
  
  Toshi Tabata
  
  --
  
  
Toshi Tabata ([EMAIL PROTECTED])
  
  
 




Re: html:button and html:radio in 1.0b2

2001-06-01 Thread Craig R. McClanahan



On Wed, 30 May 2001, Klaus Thiele wrote:

 Hello,
 
 i'm currently switching our application from struts-0.5 to 1.0b2
 and i have to made some stupid changes in some of my
 jsp-pages:
 
 1) html:radio accepts no 'tabindex'
 2) html:button does not get his label from the tag-body (html:submit does it)
 
 is there a reason for this changes?
 

Both of those were bugs, and both were fixed today -- they'll be correct
in the 20010602 nightly build (as well as in the 1.0 final release when it
comes out).

 thanks
   klaus
 

Craig




RE: Multipage forms and validation

2001-06-01 Thread David Winterfeldt

It hasn't been discussed by the other volunteers and
Struts users/developers exactly what features the
client/standard validations should have.  I'll send an
e-mail to get the discussion started.

David

--- Niall Pemberton [EMAIL PROTECTED]
wrote:
 David,
 
 I see your on the 1.1 ToDo list as a volunteer for
 Standard Validations
 and Client Side Validations - is it likely your
 validation framework is
 going to be adopted for Struts - and if so how close
 is what you're offering
 now to what Struts will have in 1.1?
 
 I'm just wondering whether to plough on with what
 we've got or wait for what
 might be coming in Struts.
 
 Niall
 
 
  -Original Message-
  From: David Winterfeldt
 [mailto:[EMAIL PROTECTED]]
  Sent: 31 May 2001 23:32
  To: [EMAIL PROTECTED]
  Subject: Re: Multipage forms and validation
 
 
  I've done some work on a validation framework for
  Struts that is based on defining rules in an xml
 file.
   Right now it depends on associating a field with
 a
  page and setting a variable in the JSP page to set
  what page you are on.  I had a long discussion
 with
  someone on how to make it not depend on
 associating
  fields with a page so it was separated from the
 view,
  but I haven't had time to finish doing that.  The
  biggest problem is that if you have a session
 scope
  bean then you still absolutely have to know if
 there
  is a checkbox field on the page so you can reset
 it.
  The best idea to get away from page numbers was to
  have a custom ActionForward for each page and pass
 in
  the checkbox fields to be reset along with the
 action.
 
  Here is the url for what I currenty have working.
  There is a multi-page example in the validator.war
 and
  jdbc-validator.war in the webapps directory.
 
  http://home.earthlink.net/~dwinterfeldt
 
  David Winterfeldt
 
  --- Lukasz Kowalczyk [EMAIL PROTECTED]
 wrote:
   Hi.
  
   I'm trying to employ Struts to help me build
   multi-page forms.
   Those forms consist of all kinds of inputs,
   including multipart.
  
   The questions are as follows:
  
   1. How can I validate forms which I know will
 never
   set all of the
   required elements at a time since the required
   elements can span multiple
   pages? I could check which submit was clicked
 and
   then validate just a
   subset of form elements but I think it's not
 very
   Struts-oriented, and
   secondly this makes validate() method dependent
 on
   specific placement of
   form inputs (when I decide to move some field to
   another page I have to
   modify validate()).
  
   2. Can I use the same Action class to handle
   multipart and non-multipart
   request? Will performance hurt because of this?
  
   --
   £ukasz Kowalczyk
  
 
 
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail
 - only $35
  a year!  http://personal.mail.yahoo.com/
 
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



Struts status items list /\/\/\

2001-06-01 Thread Jonathan Asbell



Can any one of you put together a list? We need to 
know:
1) what can currently be thrown out (assuming I 
have the most recent evenings build)
2) what are, and where canweobtain all 
of the recently contributed pieces which are under consideration, being worked 
on or tested (the Token mechanism submission, the iterate patch, the message 
patch, validation, bean factory, auto beans,  etc. etc. etc.)
3) what is next item that has been decided but has 
not been included in any nightly build.
4) what specific areas are we 
currentlylooking at to solve 

Just a brief list for the rest of us to have an 
idea of current state and the direction in thenear future. It will 
effect what we are personally building.

Cheers.
Jonathan