How do un-load (destroy) a servlet after startup?

2003-11-07 Thread Michael Cardon
Hello,

I have a couple of servlets that I start with my struts application that
read some xml files and initialize my program for use.  After the
initialization is done, I no longer need the servlets and would like to
un-load (destroy) them. Does anyone know how to do this?

Thanks.


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



Best Practices in Struts for Form objects?

2003-11-06 Thread Michael Cardon
Hello,

If I have 5 Action classes that all need to reference the same Form object,
should I map each Action to the same form name, or use different names for
each of the Forms in the Actions?  Does it make a difference if I’m using
session scope vs. request scope?

Example using the same form names, same form class:

form-bean name=pwForm type=mim.struts.form.SelectForm/

actionpath=/teacherPw
   type=mim.struts.action.pw.StudentPwAction
   name=pwForm
  scope=request
   validate=false
  parameter=dispatch
  forward name=success   path=mim.pw.list/
/action

actionpath=/studentPw
   type=mim.struts.action.pw.StudentPwAction
   name=pwForm
  scope=request
   validate=false
  parameter=dispatch
  forward name=success   path=mim.pw.list/
/action

... 3 more actions 


Example using diferent form names, same form class:

form-bean name=teacherpwForm type=mim.struts.form.SelectForm/
form-bean name=studentpwForm type=mim.struts.form.SelectForm/

actionpath=/teacherPw
   type=mim.struts.action.pw.StudentPwAction
   name=teacherpwForm
  scope=request
   validate=false
  parameter=dispatch
  forward name=success   path=mim.pw.list/
/action

actionpath=/studentPw
   type=mim.struts.action.pw.StudentPwAction
   name=studentpwForm
  scope=request
   validate=false
  parameter=dispatch
  forward name=success   path=mim.pw.list/
/action

... 3 more actions 

Thanks


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



RE: Re: Specifying comma-delimted Struts Config Files

2003-03-12 Thread Michael Cardon
Chuck,

I've never been able to get the comma config file feature to work, but you
did? If you can tell me how you did it, I would appreciate it. Here is my
sniplet from my web.xml file:

init-param
  param-nameconfig/param-name
  param-value
/WEB-INF/struts-config.xml, /WEB-INF/struts-config-reports.xml
  /param-value
/init-param

Thanks.

-Original Message-
From: Chuck Cavaness [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 1:41 PM
To: Struts Users Mailing List
Subject: Re: Re: Specifying comma-delimted Struts Config Files


As embarassing as it is to admit, the error was a pure operator type error.
There was an action-mappings element missing in the second config file. I
was actually taking one config file apart and splitting it into two to
demonstrate this feature. Why the error complained about a missing
/struts-config, I'm not sure.

Anyway, the feature works as expected. Sorry for the distraction. Back to
your regularly scheduled program...

chuck



 From: Rick Reumann [EMAIL PROTECTED]
 Date: 2003/03/12 Wed PM 04:15:53 EST
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: Specifying comma-delimted Struts Config Files

 On Wed, 12 Mar 2003 16:00:46 -0500
 Chuck Cavaness [EMAIL PROTECTED] wrote:

  Is anyone using the feature of the framework where you can specify
  multiple configuration files in the web.xml:

 Sorry I can't help Chuck, since I'm not using multiple config.xml's.
 I'd like to start using them though, so when you figure what the problem
 is could you please post the solution (since I'm sure I'll run across it
 as well).


 Thanks,

 --
 Rick Reumann

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




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


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



RE: Re: Specifying comma-delimted Struts Config Files

2003-03-12 Thread Michael Cardon
Thanks David, I did, but it still doesn't work. When I start my tomcat
server I get the following error:

SEVERE: Parsing error processing resource path
java.lang.NullPointerException
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:9
41)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
4)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3420)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


Any more idea?


-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 1:51 PM
To: [EMAIL PROTECTED]
Subject: RE: Re: Specifying comma-delimted Struts Config Files


Try removing the space after the comma.

David



I've never been able to get the comma config file feature to work, but you
did? If you can tell me how you did it, I would appreciate it. Here is my
sniplet from my web.xml file:

 init-param
   param-nameconfig/param-name
   param-value
   /WEB-INF/struts-config.xml, /WEB-INF/struts-config-reports.xml
   /param-value
 /init-param

Thanks.

-Original Message-
From: Chuck Cavaness [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 1:41 PM
To: Struts Users Mailing List
Subject: Re: Re: Specifying comma-delimted Struts Config Files


As embarassing as it is to admit, the error was a pure operator type error.
There was an action-mappings element missing in the second config file. I
was actually taking one config file apart and splitting it into two to
demonstrate this feature. Why the error complained about a missing
/struts-config, I'm not sure.

Anyway, the feature works as expected. Sorry for the distraction. Back to
your regularly scheduled program...

chuck


 
  From: Rick Reumann [EMAIL PROTECTED]
  Date: 2003/03/12 Wed PM 04:15:53 EST
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: Re: Specifying comma-delimted Struts Config Files
 
  On Wed, 12 Mar 2003 16:00:46 -0500
  Chuck Cavaness [EMAIL PROTECTED] wrote:
 
   Is anyone using the feature of the framework where you can specify
   multiple configuration files in the web.xml:
 
  Sorry I can't help Chuck, since I'm not using multiple config.xml's.
  I'd like to start using them though, so when you figure what the problem
  is could you please post the solution (since I'm sure I'll run across it
  as well).
 
 
  Thanks,
 
  --
  Rick Reumann
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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


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


_
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


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


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



RE: date format problems

2003-03-06 Thread Michael Cardon
Here is what I do. The client enters a date of birth date as a string on the
form, then I convert it to a java.sql.Date object in this method.


/**
 * Sets the dobStr
 * @param dobStr The dobStr to set
 */
public void setDobStr(String dobStr) throws java.text.ParseException {
this.dobStr = dobStr;

// reset the Date object
this.dobDate = null;

if ((dobStr != null)  (dobStr.length()  0)) {
SimpleDateFormat sdf = new SimpleDateFormat(MM/dd/yy);
sdf.setLenient(false);

try {
java.util.Date dt = sdf.parse(dobStr);
this.dobDate = new java.sql.Date(dt.getTime());

} catch (ParseException pe) {
throw new java.text.ParseException(Date Of Birth:,
pe.getErrorOffset());
}
}
}

-Original Message-
From: Søren Blidorf [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 3:42 PM
To: 'Struts Users Mailing List'
Subject: SV: date format problems


Hi.
Thanks for all the answers

I was trying different things because nothing would work for me.

I need one thing:

Convert the String value theForm.GetMyDate() so that I can insert it in
my sql as -MM-dd.

I get the error java.lang.IllegalArgumentException: Cannot format given
Object as a Date

I will look at BeanUtils.copyProperties( beanToCopyTo, beanCopyingFrom
);, but it is probably to complicated for me just now!

What is the best way to fix it?

-Oprindelig meddelelse-
Fra: Chen, Gin [mailto:[EMAIL PROTECTED]
Sendt: 6. marts 2003 16:31
Til: 'Struts Users Mailing List'
Emne: RE: date format problems

The standard for an actionForm is to have every field as String.
All conversion (which should really be thought of as business logic)
should
occur in the Action classes or further down the food chain. If this is
not
possible in your case or does not solve what your working on then can
you
please give more details?
-Tim


-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 10:21 AM
To: Struts Users Mailing List
Subject: RE: date format problems


I'm no expert at struts but I  convert and validate my dates in my
Action or
Business Class instead of the Form.  I could be completely off-base here
in
my interpretation of the struts ActionForm though

-Original Message-
From: Søren Blidorf [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 10:07 AM
To: [EMAIL PROTECTED]
Subject: date format problems


Hi.

I have an action that gets a date from the MS SQL 2000 in -MM-dd. I
convert it with simpledateformat as dd-MM- and put it in a jsp form.
When submitting the form the date must be coverted back to -MM-DD
before another actions update the db.

I am trying to convert the date value in the ActionForm, but I am
getting the following error.

Any idears? I am lost and it is very urgent

Søren Blidorf


HTTP Status 500 -




type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: BeanUtils.populate
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774)
at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.jav
a:2061)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:550)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at

deprecated constant

2003-02-19 Thread Michael Cardon
In version 1.1b3 Action.DATA_SOURCE_KEY is deprecated.

Can anyone tell me real quick what replaces this?

Thanks.

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




RE: deprecated constant

2003-02-19 Thread Michael Cardon
Thanks Wendy.


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 8:53 AM
To: 'Struts Users Mailing List'
Subject: RE: deprecated constant


Michael wrote:
 In version 1.1b3 Action.DATA_SOURCE_KEY is deprecated.
 Can anyone tell me real quick what replaces this?

http://jakarta.apache.org/struts/api/org/apache/struts/action/Action.html

-- 
Wendy Smoak


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




Resource Path problem

2003-02-18 Thread Michael Cardon
I just upgraded to Struts 1.1b3

I get the following error when I start my application.

If anyone can point me in the right direction here, I would appreciate it.


ERROR Message:

Starting service Tomcat-Standalone
Apache Tomcat/4.1.18-LE-jdk14
Feb 18, 2003 10:33:34 AM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Feb 18, 2003 10:33:34 AM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
Feb 18, 2003 10:33:35 AM org.apache.struts.action.ActionServlet
initModuleConfig
SEVERE: Parsing error processing resource path
java.lang.NullPointerException


I have two resource bundles, and it use to work before

!--  The message resources location.  --
message-resources parameter=ApplicationResources null=false/
message-resources key=ReportResources parameter=ReportResources
null=false/


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




RE: Resource Path problem

2003-02-18 Thread Michael Cardon
You were right about the problem with my struts-config.xml file.

I tried to implement 2, comma delimited config.xml files in my web.xml file:

init-param
  param-nameconfig/param-name
  param-value
/WEB-INF/struts-config.xml,
/WEB-INF/struts-config-reports.xml
  /param-value
/init-param


I don't know why this didn't work ???




-Original Message-
From: Damm, Gary [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 18, 2003 12:06 PM
To: Struts Users Mailing List
Subject: RE: Resource Path problem


Not sure but it looks like it may be having a problem finding your
servlet config file (struts-config.xml) and not your message resources.
I had a similar problem in the past and it wasn't finding my config
file.

Gary

-Original Message-
From: Michael Cardon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 18, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: Resource Path problem

I just upgraded to Struts 1.1b3

I get the following error when I start my application.

If anyone can point me in the right direction here, I would appreciate
it.


ERROR Message:

Starting service Tomcat-Standalone
Apache Tomcat/4.1.18-LE-jdk14
Feb 18, 2003 10:33:34 AM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Feb 18, 2003 10:33:34 AM org.apache.struts.util.PropertyMessageResources
init
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
Feb 18, 2003 10:33:35 AM org.apache.struts.action.ActionServlet
initModuleConfig
SEVERE: Parsing error processing resource path
java.lang.NullPointerException


I have two resource bundles, and it use to work before

!--  The message resources location.  --
message-resources parameter=ApplicationResources null=false/
message-resources key=ReportResources parameter=ReportResources
null=false/


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


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


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




RE: [OT - Java] Need a recommendation on a Design Pattern class

2003-02-11 Thread Michael Cardon
I took a week long class from Bruce Eckel a couple of years ago that I would
recommend. http://www.BruceEckel.com


-Original Message-
From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 10:34 AM
To: Struts Users Mailing List
Subject: RE: [OT - Java] Need a recommendation on a Design Pattern class


You can fly me to your offices and I will talk for 5 days on design patterns
:-)

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Tue 2/11/2003 11:35 AM
To: '[EMAIL PROTECTED]'
Cc:
Subject: [OT - Java] Need a recommendation on a Design Pattern class



Hi All,

Sorry for the OT post, but I need a recommendation from all you guru's out
there.  I've been asked to find a 3 to 5 day class on Design Patterns with
a
Java slant.  If anyone has attended something like this, and can recommend
for (or against), I would appreciate it.  You can reply via the list or
directly to me.

TIA!

Jerry Jalenak
Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]


This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[EMAIL PROTECTED]



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






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




RE: html:link throws NPE

2003-01-28 Thread Michael Cardon
Did you try it with a forward slash like this?

html:link page=/search.doSearch/html:link



-Original Message-
From: Ethan Michaels [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 7:34 PM
To: Struts Users Mailing List
Subject: RE: html:link throws NPE


Thank you for the suggestion. I did try that, but it's
still throwing an exception. I tried...

html:link page=search.doSearch/html:link

Now the method RequestUtils.pageURL is added to the
exception message.

I forgot to mention in my original post that in my
struts-config, I've also defined a global forward for
this action...

forward
name=search
path=/search.do/


Thanks,

Ethan




--- Nadeemullah Hussain
[EMAIL PROTECTED] wrote:
 Hi,
   Use the link tag as I have mentioned below instead
 of the one u have used.

 html:link page=/search.do?Search/html:link

 Thanks,
 Nadeem,
 Wipro Technologies,Chennai
 Tel - 91-44-4500200 X : 2111
 Mobile : 98401 47663


 -Original Message-
 From: Ethan Michaels [mailto:[EMAIL PROTECTED]]

 Sent: Wednesday, January 29, 2003 8:18 AM
 To: Struts Users Mailing List
 Subject: html:link throws NPE


 Hi. I'm trying to get a simple link to work on a
 page.
 I use a link tag like this:

 html:link forward=searchSearch/html:link

 When I try to load the page using JRun 4, a null
 pointer exception shows up in standard output. The
 method that thows the exception is

 RequestUtils.computeURL()

 In my struts-config.xml file, I have

 action
 path=/search
 type=org.apache.struts.actions.ForwardAction
 parameter=/search.jsp/

 The exception message seems to be saying, I guess,
 that it's having trouble figuring out the URL to
 use.
 I've tried including an html:base/ tag at the top
 of
 the page, and defining the action differently, for
 example...

 action
 path=/search.do
 type=org.apache.struts.actions.ForwardAction
 parameter=/search.jsp/

 action
 path=search
 type=org.apache.struts.actions.ForwardAction
 parameter=/search.jsp/

 action
 path=/search
 type=org.apache.struts.actions.ForwardAction
 parameter=/newsarchive/search.jsp/

 Nothing seems to work. I've tried abandonning the
 link
 tag altogether and just explicitly providing the
 link,
 like so:

 a href=/newsarchive/search.doSearch/a

 But then I get an error saying that a GET request is
 not supported by this URL.

 I would be grateful for any help with this.

 Thanks,

 Ethan

 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up
 now. http://mailplus.yahoo.com


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

 
**Disclaimer
**


  Information contained in this E-MAIL being
 proprietary to Wipro Limited is 'privileged'
 and 'confidential' and intended for use only by the
 individual or entity to which it is
 addressed. You are notified that any use, copying or
 dissemination of the information
 contained in the E-MAIL in any manner whatsoever is
 strictly prohibited.










__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


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




Can Action Forward be used to open a new brower window?

2003-01-22 Thread Michael Cardon
I am using struts 1.1 beta 2

I use the DispatchAction object using a display method in the class:

public class AssessmentAnalysisAction extends DispatchAction {

public ActionForward display(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {

HttpSession session = request.getSession();
AssessmentAnalysisForm aaf = (AssessmentAnalysisForm)form;
ActionErrors errors = new ActionErrors();
int debugLevel = servlet.getDebug();

... code 

// Load the form displaying the report data
return mapping.findForward(success);
}
}

I have mapped the 'success' key to the jsp page in struts-conf.xml

actionpath=/assessmentAnalysis
   type=com.mim.struts.reports.AssessmentAnalysisAction
   name=assessmentAnalysisForm
  scope=request
  parameter=dispatch
  forward name=success   path=/reports/assessmentAnalysis.jsp/
/action


Is what I would really like, is to have the jsp page open in a new brower
window. Is this possible? Thanks.

Michael Cardon
[EMAIL PROTECTED]


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




RE: Can Action Forward be used to open a new brower window?

2003-01-22 Thread Michael Cardon
Thanks Max,

The links work fine if I'm going straight to a jsp page, but I hit the
Action class before the jsp is rendered and that's why I have this problem.

I was hoping there was a parameter I could include in the forward tag of the
struts-conf.xml file that would open the page in a new browser window, but
such is not the case.

forward name=success   path=/reports/assessmentAnalysis.jsp
target=_blank /

It was just some wishful thinking on part of something I was trying to do.


-Original Message-
From: Max Cooper [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 11:58 AM
To: Struts Users Mailing List
Subject: Re: Can Action Forward be used to open a new brower window?


Forwards happen on the server, so there is no simple way to have a forward
pop up in a new window. If the browser makes a request for /showItToMe.do,
you can forward it 1,000 times on the server and it is still just one
request to the browser. And it is going to display the response in whatever
browser window made the request.

However, you can make the action pop up in a new window by changing the
links to that action. This is probably what you want to do. On the page that
has the link to your action, have it render HTML like this:

a href=/yourContextPath/assessmentAnalysis.do target=newClick me/a

instead of just:

a href=/yourContextPath/assessmentAnalysis.doClick me/a

(Obviously, this is a very simple example. You'll probably want to use
html:link and perhaps even some JavaScript to control the pop-up window's
properties. I am sure there are many resources with details about creating
pop-up windows available on the web.)

I imagine you could also do some kind of response that had both some page
content for the main window, plus a JavaScript to open a new window and
request the other action. But, that would be messy and many people have this
kind of browser functionality disabled to avoid unwanted pop-ups. This is
probably not a good idea.

-Max

- Original Message -
From: Michael Cardon [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 10:40 AM
Subject: Can Action Forward be used to open a new brower window?


 I am using struts 1.1 beta 2

 I use the DispatchAction object using a display method in the class:

 public class AssessmentAnalysisAction extends DispatchAction {

 public ActionForward display(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response) {

HttpSession session = request.getSession();
 AssessmentAnalysisForm aaf = (AssessmentAnalysisForm)form;
 ActionErrors errors = new ActionErrors();
 int debugLevel = servlet.getDebug();

 ... code 

 // Load the form displaying the report data
return mapping.findForward(success);
 }
 }

 I have mapped the 'success' key to the jsp page in struts-conf.xml

 actionpath=/assessmentAnalysis
type=com.mim.struts.reports.AssessmentAnalysisAction
name=assessmentAnalysisForm
   scope=request
   parameter=dispatch
   forward name=success   path=/reports/assessmentAnalysis.jsp/
 /action


 Is what I would really like, is to have the jsp page open in a new brower
 window. Is this possible? Thanks.

 Michael Cardon
 [EMAIL PROTECTED]


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





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


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