Re: Struts Tooling

2003-02-06 Thread Ying
Hi Robert -

A good example of tiles application is tiles-documentation.war
that comes with the Struts 1.1b3 distribution. The example
uses the ActionServlet (instead of ActionComponentServlet)
and it runs correctly (under WSAD 5.0 Test environment)
with a few modification.. as listed below.

You need to fix struts-doc-config.xml at:
 should be 
and

From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>Subject: Struts Tools
>Date: Thu, 6 Feb 2003 09:27:37 -0500 
>Content-Type: multipart/alternative;
>   boundary="_=_NextPart_001_01C2CDEB.E5D7D0D0"
>
>
>Do you use tile plugins ?
>Do you use struts 1.1.3
>Your action servet in web.xml is ActionComponentServlet or ActionServlet
>I ask this question because when I use ActionComponentServlet it's work with
>a warning 
>But when i use ActionServlet It doesn't work att all 
>
>Can you show or send me your web.xml and your strut-config.xml files.
>
>Thanks you verry much it's been a while that I try to make workink struts
>1.1.3 with websphere 5.0
>
>
>-Message d'origine-
>De : Gary Johnston <[EMAIL PROTECTED]> [mailto:[EMAIL PROTECTED]] 
>Envoy±³° : 6 f±³°vrier, 2003 09:18
>¶µ : [EMAIL PROTECTED]
>Objet : RE : Struts Tools
>
>
>Robert,
>BTW, the bogus error message(s) you're seeing is a known problem that 
>is fixed in a soon-to-be released fix bundle.  It'll be 
>downloadable/installable into WebSphere Studio 5.0 via the 
>Eclipse "Update Manager".  For now, please just continue to ignore 
>them.  Sorry.
>- Gary Johnston
>IBM WebSphere Studio Struts Tools Development Lead
>IBM Software Group, RTP, NC
>
>--- In [EMAIL PROTECTED], Robert Claeson <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>> > WSAD 5.0 with tiles-definitions and struts 1.1 dont work with
>exemples of
>> > configuration give by apache
>> 
>> I actually haven't tried those examples. I just follow the API
>guides. I 
>> use Tiles and definitions. It works for me for what I've done with
>it so 
>> far (developed an e-business application with a quite complex
>layout 
>> based on tiles, and web services integration with a license
>management 
>> system located on a different continent), except for the bogus
>error 
>> message I mentioned.
>> 
>> /Robert
>> 
>> 
>> 
>-
>> 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 Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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




RE: RE : Struts Tooling wsad 5

2003-02-06 Thread Ying
I am not sure if the build of WSAD matters... but who knows.
Unfortunately I don't have access to that particular version
of WSAD so I can't really say if this is the case..

But - taking a stab at your problem..
Looking at some struts code.. the message: 
"Can't get definitions factory from context" is thrown
as a FactoryNotFoundException by the method :
static public ComponentDefinition getDefinition(String definitionName, ServletRequest 
request, ServletContext servletContext) 
in TilsUtil class.

So - it looks more like a configuration problem. That is,
it can't find the definition files.  But - I am not sure why tiles-documentation.war 
did not work on your setup. 
Unfortunately I don't know where the documentation is
for using tiles for using ActionComponentServlet.
I would guess, that the reason ActionComponentServlet works 
is because your definition files are listed in your web.xml:

  definitions-config
/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,
 /WEB-INF/tiles-examples-defs.xml


Maybe you've forgot to list them in your struts-config.xml
file?? as 
 


  


Just a thought.
Not a tiles expert here :)

Ying


[EMAIL PROTECTED] wrote:

>Hi,
>Thanks, for your help.
>But I try what you tell and I still receive the same error:
>"Can't get definitions factory from context".
>
>But if I change the web xml file and comment the actionservlet class and use
>the actioncomponentservlet
>
>
>org.apache.struts.tiles.ActionComponentServlet>
>
>It's work with a warning.
>"Warning - ActionComponentServlet class: This class is to be used with
>Struts1.0.x only. Please modify web.xml to use regular ActionServlet class
>instead in conjugaison with appropriate plugin declared in
>struts-config.xml."
>
>I will translate this by circle bug. The problem is that I need to use
>ActionServlet.
>
>I heard that there is different version of websphere 5.0 : different build
>version, maybe is the reason of my bug. I use
>WebSphere Studio Application Developer (Windows)
>Version: 5.0.0
>Build id: 20020913_0100
>
>-Message d'origine-
>De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Envoyé : 6 février, 2003 13:32
>À : [EMAIL PROTECTED]
>Objet : Re: Struts Tooling
>
>
>Hi Robert -
>
>A good example of tiles application is tiles-documentation.war that comes
>with the Struts 1.1b3 distribution. The example uses the ActionServlet
>(instead of ActionComponentServlet) and it runs correctly (under WSAD 5.0
>Test environment) with a few modification.. as listed below.
>
>You need to fix struts-doc-config.xml at:
> should be 
>and
>
> value="/WEB-INF/tiles-defs.xml,
>/WEB-INF/tiles-doc-defs.xml />
>is missing a end "
>
>
>Not sure where the definition from this file is used - but
>I think it is better to just fix that.
>
>If you use WSAD IDE to import the .war file, it will also flag some errors..
>(*.jsps - tiles.tld not there and etc..) I just ignored it (this is probably
>something that is not too bad to fix).
>
>I think its likely that you are just missing a few configuration information
>in your web.xml (requirements probably changed much from Struts 1.0 to
>Struts 1.1)
>
>Hope this helps.
>
>Ying
>
>>From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>>Subject: Struts Tools
>>Date: Thu, 6 Feb 2003 09:27:37 -0500
>>Content-Type: multipart/alternative;
>>   boundary="_=_NextPart_001_01C2CDEB.E5D7D0D0"
>>
>>
>>Do you use tile plugins ?
>>Do you use struts 1.1.3
>>Your action servet in web.xml is ActionComponentServlet or
>>ActionServlet I ask this question because when I use
>>ActionComponentServlet it's work with a warning But when i use
>>ActionServlet It doesn't work att all
>>
>>Can you show or send me your web.xml and your strut-config.xml files.
>>
>>Thanks you verry much it's been a while that I try to make workink
>>struts 1.1.3 with websphere 5.0
>>
>>
>>-Message d'origine-
>>De : Gary Johnston <[EMAIL PROTECTED]> [mailto:[EMAIL PROTECTED]]
>>Envoy±³° : 6 f±³°vrier, 2003 09:18
>>¶µ : [EMAIL PROTECTED]
>>Objet : RE : Struts Tools
>>
>>
>>Robert,
>>BTW, the bogus error message(s) you're seeing is a known problem that
>>is fixed in a soon-to-be released fix bundle.  It'll be
>>downloadable/installable into WebSphere Studio 5.0 via the
>>Eclipse "Update Manager".  For now, please just continue to ignore
>>them.  Sorry.
>>- Gary Johnston
>>IBM W

Re: ValidatorActionForm example?

2003-02-18 Thread Ying
Hi Jeff..

This is what you need to do:
1. Define a form bean which extends ValidatorActionForm 
2. Define a action in which you use this form bean.  (suppose /myAction)

And in the validator.xml you need to do
   <--- the action that uses the formbean
   


Note that if you have another action defined using the same form bean..

   

A thing to remember if you are doing client side validation...

The formname needs to map exactly to the form name... (including the slash)
and because of the slash, the default generated name is invalid javascript.. so you 
need to use "method =" to specify the generated 
method.

Hope this helps.

Ying

__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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




Re: Javascript displayed on page

2003-02-27 Thread Ying
Hi -

Not sure if this is the same problem as you are having..
But - I've run into a similar problem when I was doing client
side validation using the validator framework.  I see javascript 
not being written out correctly (missing script tags)
when I do:



when I didn't have a  defined in the 
validation.xml.

Ying

> From: Sloan Seaman
> Subject: Javascript displayed on page
> Date: Wed, 26 Feb 2003 09:10:41 -0800
>
>What woudl cause Struts to put Javascript into a page but NOT put
>
>
><!-- Begin
>and
>//End -->
>
>
>It seems to be leaving it out for me on a certain page.  On other pages it
>works fine though.
>
>Also, is there any way to get strust to send only the javascript methods it
>needs?  Right now it sends a lot of methods that are not needed for my
>forms.
>
>Thanks!
>
>--
>Sloan
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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



RE: What is the best struts plugin for Eclipse?

2003-03-03 Thread Ying

IBM WebSphere Studio Application/Site Developer (not free)
has a struts plugin.  It has a editor (Web Diagram Editor)
that you can use for visualizing application flow,
in addition to alot of other stuff.

I can only find a tech preview blurb on it:
http://www7b.software.ibm.com/wsdd/downloads/struts_tools.html

It has been released (GA'ed) with WSSD.. as of last Nov.

See:
http://www-3.ibm.com/software/awdtools/studioappdev/
http://www-3.ibm.com/software/awdtools/studiositedev/

Trial version of WSAD is available (just search www.ibm.com)

and a white paper on how to write a simple struts app using it.
http://www7b.boulder.ibm.com/wsdd/techjournal/0302_fung/fung.html

Ying



>RE: What is the best struts plugin for Eclipse?
>
>* From: Alban Soupper
>* Subject: RE: What is the best struts plugin for Eclipse?
>* Date: Mon, 03 Mar 2003 04:19:49 -0800 
>
>Console is not bad, but in fact
>I would like something that can graphically represent
>my pages interractions 
>
>Because in a large application the actions, forms, jsp
>are very soon interlaced and the application behaviour is
> not really clear...
>
>
>
>-Original Message-
>From: Dejan Krsmanovic [mailto:[EMAIL PROTECTED]
>Sent: lundi, 3. mars 2003 11:49
>To: Struts Users Mailing List
>Subject: Re: What is the best struts plugin for Eclipse?
>
>
>Struts Console. Try to download it from www.jamesholmes.com/struts/console
>I am not sure if it works with Eclipse 2.1 but I guess it does. It is not as
>well integrated as Easy Struts is
>but has support for editing validator and tiles config files
>
>Dejan
>
>
>- Original Message -
>From: "Alban Soupper" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Sent: Monday, March 03, 2003 11:44 AM
>Subject: RE: What is the best struts plugin for Eclipse?
>
>
>> That's my problem easy struts doesn't work correctly on the version
>> of Eclipse that we use :(
>>
>>
>> Another candidate?
>>


__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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



Re: Re: questions about struts validator

2003-01-15 Thread Ying

comments.

>- Original Message -
>From: "Giri Alwar" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Date: Wed, 15 Jan 2003 13:40:33 -0600
>Subject: Re: questions about struts validator
>
>
>See my comments below.
>
>- Original Message -
>From: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 15, 2003 11:40 AM
>Subject: questions about struts validator
>
>
>> Hello -
>>
>> After reading the struts validator documentation, I had some
>> questions about it and was wondering if anyone knows the answer
>> off the top of their head...
>>
>> Here are some questions:
>>
>> 1. Is there documentation on what 's are available for
>> the standard Validators (the ones that came with the Struts1.1b3
>> webapp, in validate-rules.xml)? Otherwise... I can read the
>> javaScript and scan for it I guess.
>>
>I haven't found one yet but here is a list of variables for the built-in
>validation rules (in the : format):
>required : no variable
>minlength : 'minlength' variable
>maxlength: 'maxlength' variable
>range : 'min' and 'max' variables (both required)
>byte, short, int, long, float, double: no variable
>date: either 'datePatternStrict' or 'datePattern' variable (one of them
>required)
>creditCard: no variable
>email: no variable
>mask: 'mask' variable
>
>> 2. If the form bean and the associated action mapping both has
>>  element defined, how does the validator run?  Is it combined,
>> i.e. validate via action mapping rule then form rules..? or only
>> the last defined gets validated? or?
>>
>Not sure what you mean here. The way to associate a form bean with an action
>mapping is through the "name" attribute in the  element.

This is the scenario that I was trying to figure out.
Suppose in the struts config file I've defined a form bean name "logonForm"
and an action named "/logon" which uses "logonForm". And suppose that
in validate.xml I've defined 
  

   ... 


   ...

  

When the user clicks on a button that triggers a form submit 
via the logon action...  What validation takes place?

Maybe my question should be:  When does validation for form bean
gets triggered?  Is it any time that an action uses it or?


>> 3. How are duplicated forms of the same name handled? that is, does
>> the last one found takes precedence?
>>
>First of all, this is not recommended - all form beans should be assigned a
>unique logical name. That said, the implementation uses a HashMap to store
>form beans. Hence, the last one wins.

Does this apply to something like this as well?

   
 ...
   
   
 ...
   


Thanks!

Ying




__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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




Re: Re: questions about struts validator

2003-01-16 Thread Ying
>> This is the scenario that I was trying to figure out.
>> Suppose in the struts config file I've defined a form bean name
>"logonForm"
>> and an action named "/logon" which uses "logonForm". And suppose that
>> in validate.xml I've defined
>>   
>> 
>>...
>> 
>> 
>>...
>> 
>>   
>>
>
>The first form entry does not make sense. The name attribute in the form
>element should be the logical name you assigned to the form bean in the
>Struts config file and not the action name.

The first form entry is possible because of the ValidatorActionForm class.
from:

http://jakarta.apache.org/struts/api/org/apache/struts/validator/ValidatorActionForm.html

"This class extends ValidatorForm and provides basic field validation based on an XML 
file. The key passed into the validator is the action element's 'path' attribute from 
the struts-config.xml which should match the form element's name attribute in the 
validation.xml."

So - I have an action name logon, and form bean logonForm which extends
ValidatorActionForm.  Action logon uses logonForm. I am guessing that -
when the path of action is executed, the "logon" validation entry gets
executed (and ignores the "logonForm" entry?)...

There is probably something missing from my question (due to probably still
lack of understanding of this). I'll have to just play with it :)
Thanks for having patience..

>> When the user clicks on a button that triggers a form submit
>> via the logon action...  What validation takes place?
>>
>> Maybe my question should be:  When does validation for form bean
>> gets triggered?  Is it any time that an action uses it or?
>>
>
>Since I don't know what your action mapping entry looks like, I will make a
>couple of  assumptions in addition to what you have stated: validation is
>enabled and the form bean is in request scope.
>
>Suppose that a request arrives for the "/logon" action path. Struts will
>first look for an attribute in the request called "logonForm" (by default
>Struts stores your form bean as an attribute using the same name as the
>logical name you gave it). In this case, it will not find your form bean in
>the request. Struts will therefore create an instance of your form bean,
>store it in the request as an attribute under the name "logonForm", call the
>reset method on it, populate it with request parameters that match setters
>in your form bean and finally call the validate method on your form bean. If
>validation succeeds (the validate method returns null or an empty
>collection), Struts will then call the execute method on the associated
>Action object. Every time a request arrives for the "/logon" action path,
>this sequence will repeat.

Thanks for the explaination!

Ying


__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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




Problem using nested struts template tag

2002-08-15 Thread Ying Gao

I use nested template tag as the following:



  

  
 
 
 
 
  

  



template.jsp is a template that contains header, content and footer.
contentTemplate.jsp is a template that contains a title image and a detail
content jsp to which I pass myContent.jsp. It works fine except that the
browser (both IE and Netscape) keeps busy for a while after the page header,
content and footer are loaded. It seems that the browser tries to load
something else.
JavaScript won't work until the browser finish loading. I have no idea what
it is loading.
It only happens when I use template:put tag to pass a content
(myContent.jsp) to the nested
template (contentTemplate.jsp) without using 'direct="true"'. If I use
'direct="true"'
the browser returns immediately but that is not what I want. I want the
content to be
included instead of printed directly.
Does anyone know what the problem is? Is there any solution or workaround?
Thanks.

Iris


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




RE: Is there a quick resource for learning nested tags?

2002-03-15 Thread Jin, Ying

Check out http://www.keyboardmonkey.com/struts/index.html. 

Thanks.
Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 12:27 PM
To: Struts Users Mailing List
Subject: Is there a quick resource for learning nested tags?



I'm starting to get burned by using  more than once in my
same JSP page.It's screwing up the results and I am getting some
bizzare server-side JSP exceptions.I think only nested tags will solve
this...I have downloaded/installed the new nightly build for struts and
modified my web.xml to know about the nested taglibary. The
documentation for nested tags on the struts web-site does not help me much.
Is there a web-site/web-application that has an example of how to setup
nested tags for iteration and beans?

thanks,
Theron


--
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]>




database connection

2001-05-02 Thread Ying Teng

Hello All,

I am trying to connect to the database but when I do

DataSource dataSource =
(DataSource)servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY)
;

it gives me null as the dataSource value. Can anybody help me out here?
Thanks.

Ying





RE: database connection

2001-05-02 Thread Ying Teng

Yes, I did. I use my SQL and mine looks like this:



  

What else do I need to do to add this datasource to struts? Thanks.

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Re: database connection




Did you set up the data source configuration in your struts-config.xml file?
I'm using oracle 8.1.6, my setup looks like this.


  


-Donnie Hall




|+--->
||  yteng@zenimax|
||  .com |
||   |
||  05/02/2001   |
||  09:39 AM |
||  Please   |
||  respond to   |
||  struts-user  |
||   |
|+--->

>---
-|
  |
|
  |   To: [EMAIL PROTECTED]
|
  |   cc: (bcc: Donnie Hall/Enron Communications)
|
  |   Subject: database connection
|

>---
-|



Hello All,

I am trying to connect to the database but when I do

DataSource dataSource =
(DataSource)servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY)
;

it gives me null as the dataSource value. Can anybody help me out here?
Thanks.

Ying










RE: database connection

2001-05-02 Thread Ying Teng

I got the following on tomcat when I first start it.

Parse Fatal Error at line 32 column -1: Next character must be ";"
terminating r
eference to entity "password".
org.xml.sax.SAXParseException: Next character must be ";" terminating
reference
to entity "password".
at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
at com.sun.xml.parser.Parser.fatal(Parser.java:2811)
at com.sun.xml.parser.Parser.nextChar(Parser.java:2735)
at com.sun.xml.parser.Parser.parseLiteral(Parser.java:707)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1347)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
at org.apache.struts.digester.Digester.parse(Digester.java:716)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
:1301)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)

at org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOn
StartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
cannot load servlet name: action

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Re: database connection




Did you set up the data source configuration in your struts-config.xml file?
I'm using oracle 8.1.6, my setup looks like this.


  


-Donnie Hall




|+--->
||  yteng@zenimax|
||  .com |
||   |
||  05/02/2001   |
||  09:39 AM |
||  Please   |
||  respond to   |
||  struts-user  |
||   |
|+--->

>---
-|
  |
|
  |   To: [EMAIL PROTECTED]
|
  |   cc: (bcc: Donnie Hall/Enron Communications)
|
  |   Subject: database connection
|

>---
-|



Hello All,

I am trying to connect to the database but when I do

DataSource dataSource =
(DataSource)servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY)
;

it gives me null as the dataSource value. Can anybody help me out here?
Thanks.

Ying










RE: database connection

2001-05-02 Thread Ying Teng

The question is how to add or specify the datasource key value. I added the
datasource tag contents in the struts-config.xml file. What else do I need
to do? Do I need add an ActionDataSource class? Do I need to use the
GenericDataSource class? Thanks.

Ying


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 12:06 PM
To: [EMAIL PROTECTED]
Subject: RE: database connection



The reason why the value is null is because that is the default when you
don't specify a "key" value for your datasource.  When that is the case you
will obtain your connection in the following manner:



   try {
  javax.sql.DataSource dataSource =
servlet.findDataSource(null);
  java.sql.Connection myConnection =
dataSource.getConnection();


  Once again, if you want to change the value from "null" to something
  else, just add " key=[something other than null] " to your datasource
  configuration.

  Hope that helps.

  -Dallas







"Ying Teng"

x.com>   cc:
 Fax to:
05/02/01 Subject: RE: database
connection
09:50 AM
Please
respond to
struts-user






Yes, I did. I use my SQL and mine looks like this:



  

What else do I need to do to add this datasource to struts? Thanks.

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Re: database connection




Did you set up the data source configuration in your struts-config.xml
file?
I'm using oracle 8.1.6, my setup looks like this.


  


-Donnie Hall




|+--->
||  yteng@zenimax|
||  .com |
||   |
||  05/02/2001   |
||  09:39 AM |
||  Please   |
||  respond to   |
||  struts-user  |
||   |
|+--->

>
---
-|
  |
|
  |   To: [EMAIL PROTECTED]
|
  |   cc: (bcc: Donnie Hall/Enron Communications)
|
  |   Subject: database connection
|

>
---
-|



Hello All,

I am trying to connect to the database but when I do

DataSource dataSource =
(DataSource)servlet.getServletContext
().getAttribute(Action.DATA_SOURCE_KEY)
;

it gives me null as the dataSource value. Can anybody help me out here?
Thanks.

Ying















unload database

2001-05-02 Thread Ying Teng

How do I unload database to its persistent storage version? If we are
running directly out of a WAR file, saving cannot occur. How do we make the
save possible?

Thanks.

Ying




RE: database connection

2001-05-03 Thread Ying Teng


What you described is true. Now my question is how to get the datasource
without referencing the actionServlet. I wanted to intialize the database
hashtable of the databaseServlet class in the databaseServlet init function.
In order to do that, I need to get the datasource. But I can not reference
the actionServlet because the action is initialized after the database is
initialized (as in the log file). Hope someone can give me some hints.
Thanks.

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 3:10 PM
To: [EMAIL PROTECTED]
Subject: RE: database connection



You will add the key information to the datasource info in you
struts-config.xml file  it will look like this:


  

Then, after that's done, the easiest way to access it is to reference it by
the action servlet (servlet),  because using actionServlet you can just do
servlet.findDataSource("the name you called your datasource")  and voila,
you have your datasource object.  From that datasource object you can
create a connection.
If you cannot access the actionServlet, then it's a little more
difficult--and actually I wouldn't be able to help much there, but at least
your question would then be "how do I get the datasource without
referencing the actionServlet"

-Dallas























RE: database connection

2001-05-03 Thread Ying Teng


The ServletContext object of databaseServlet or the ActionServlet? Could you
be more specific? Thanks.


-Original Message-
From: Vivek Bhaskaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: database connection


A reference to the DataSource is stored in the ServletContext object... You
can get it from that.

- Original Message -
From: "Ying Teng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 11:28 AM
Subject: RE: database connection


>
> What you described is true. Now my question is how to get the datasource
> without referencing the actionServlet. I wanted to intialize the database
> hashtable of the databaseServlet class in the databaseServlet init
function.
> In order to do that, I need to get the datasource. But I can not reference
> the actionServlet because the action is initialized after the database is
> initialized (as in the log file). Hope someone can give me some hints.
> Thanks.
>
> Ying
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: database connection
>
>
>
> You will add the key information to the datasource info in you
> struts-config.xml file  it will look like this:
> 
>key="[some name I'll use to reference this datasource]"
>autoCommit="false"
>description="Data Source Configuration"
>driverClass="org.gjt.mm.mysql.Driver"
>maxCount="4"
>minCount="2"
>password="pass"
>
> url
> ="jdbc:mysql://bethsoft.dev.zenimax.com:3306/test?user=user&password=pass
> "
>user="user"
> />
>   
>
> Then, after that's done, the easiest way to access it is to reference it
by
> the action servlet (servlet),  because using actionServlet you can just do
> servlet.findDataSource("the name you called your datasource")  and voila,
> you have your datasource object.  From that datasource object you can
> create a connection.
> If you cannot access the actionServlet, then it's a little more
> difficult--and actually I wouldn't be able to help much there, but at
least
> your question would then be "how do I get the datasource without
> referencing the actionServlet"
>
> -Dallas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





RE: database connection

2001-05-04 Thread Ying Teng

Yes, I can get the DataSource reference in the ServletContext object of the
ActionServlet class. But I want to get the reference to the dataSource in
the DatabaseServlet class. Can anyone tell me how to get the reference to
the dataSource from the databaseServlet class? Thanks.

Ying

-Original Message-
From: Vivek Bhaskaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: database connection


A reference to the DataSource is stored in the ServletContext object... You
can get it from that.

- Original Message -
From: "Ying Teng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 11:28 AM
Subject: RE: database connection


>
> What you described is true. Now my question is how to get the datasource
> without referencing the actionServlet. I wanted to intialize the database
> hashtable of the databaseServlet class in the databaseServlet init
function.
> In order to do that, I need to get the datasource. But I can not reference
> the actionServlet because the action is initialized after the database is
> initialized (as in the log file). Hope someone can give me some hints.
> Thanks.
>
> Ying
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: database connection
>
>
>
> You will add the key information to the datasource info in you
> struts-config.xml file  it will look like this:
> 
>key="[some name I'll use to reference this datasource]"
>autoCommit="false"
>description="Data Source Configuration"
>driverClass="org.gjt.mm.mysql.Driver"
>maxCount="4"
>minCount="2"
>password="pass"
>
> url
> ="jdbc:mysql://bethsoft.dev.zenimax.com:3306/test?user=user&password=pass
> "
>user="user"
> />
>   
>
> Then, after that's done, the easiest way to access it is to reference it
by
> the action servlet (servlet),  because using actionServlet you can just do
> servlet.findDataSource("the name you called your datasource")  and voila,
> you have your datasource object.  From that datasource object you can
> create a connection.
> If you cannot access the actionServlet, then it's a little more
> difficult--and actually I wouldn't be able to help much there, but at
least
> your question would then be "how do I get the datasource without
> referencing the actionServlet"
>
> -Dallas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





update database.xml

2001-05-07 Thread Ying Teng

Hi all,

I have a question to ask. I want to update the database.xml file and the
database hashtable of the DatabaseServlet class every time the user
register. So when the user logs on next time (even after the tomcat is
restarted), he/she can still log on. Any idea?

Thanks.

Ying

P.S. I already successfully updated the database in the perform function of
the SaveRegistrationAction class.




destroy() of DatabaseServlet

2001-05-07 Thread Ying Teng

Hi All,

I noticed that when the tomcat shuts down, it does NOT call the destroy()
method of the DatabaseServlet class. How to let the destroy() method get
called when the server shuts down? Thanks.

Ying




RE: update database.xml

2001-05-08 Thread Ying Teng


This makes a lot of sense. Could you please describe the steps to deploy the
application with the deploy.tomcat Target of the Struts build.xml? Thanks.

Ying

-Original Message-
From: Uwe Pleyer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 3:13 AM
To: [EMAIL PROTECTED]
Subject: Re: update database.xml


Hi,

the problem is the logic of Tomcat. If you deploy the application as *.war
file
in the webapps directory of Tomcat, at start time a directory with the same
name as the *.war file will be created and the contents of the *.war file
unpacked into this directory. So far so good, all entries in database.xml as
in
in the *.war file are available.

During shutdown the database servlet overrides the database.xml file with
the
new User-list out of the hashtable, thats already fine. But after doing all
this work, Tomcat destroyes the subdirectory of your application!!!
Everything
gets lost.

If you deploy your application with the deploy.tomcat Target of the Struts
build.xml, no *.war file will generated. Instead the Applications
subdirectory
itself is created, so Tomcat leaves everything as it is. Now the Users are
written back to database.xml at shutdown and reread at startup of Tomcat.

Another possibility is to use an path to the database.xml file wich is
outside
of the webapps directory, but I don't know if there are limitations due to
security reasons.

Greetings
Uwe

Ying Teng schrieb:

> Hi all,
>
> I have a question to ask. I want to update the database.xml file and the
> database hashtable of the DatabaseServlet class every time the user
> register. So when the user logs on next time (even after the tomcat is
> restarted), he/she can still log on. Any idea?
>
> Thanks.
>
> Ying
>
> P.S. I already successfully updated the database in the perform function
of
> the SaveRegistrationAction class.





setContentType() for xml output

2001-05-31 Thread Wu, Ying (LNG-CIS)

I need to send a string which represents a xml file to browser, I need to
call response.setContentType("text/xml").  But it is at ActionServlet level
and is default to "text/html".

1. Any idea?
2. I can do the output at MyAction.perform() level, but how to handle the
return type of this method?

Thanks.

Ying




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 7:06 AM
To: unlisted-recipients
Cc: [EMAIL PROTECTED]
Subject: RE: Form tag problem in VAJ 3.5.3 WTE with 1.0b2


Thanks John.

For now we simply stepped back to b1.
But maybe this indicates that your changes should be applied struts, so
that we can all benefit from it.

-hendrik



> Hi Hendrik,
> 
> This is a 'feature' of WTE. To resolve it edit
> org.apache.struts.taglib.FormTag.doEndTag so the first two lines read
:
> 
> // Remove the page scope attributes we created
> pageContext.removeAttribute(Constants.BEAN_KEY);
> pageContext.removeAttribute(Constants.FORM_KEY);
> 
> This seems to resolve the issue, not sure if its the best way round it
> however.
> 
> Jon.
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: 22 May 2001 06:40
> To: [EMAIL PROTECTED]
> Subject: Form tag problem in VAJ 3.5.3 WTE with 1.0b2
> 
> 
> Hi,
> 
> we just downloaded and tried the new beta2 and experienced problems
with
> Visual Age Websphere Test Environement 3.5.3. It seems that it does
not
> allow to remove attributes from a request, which is apparently done by
> the form tag.
> 
> Does anybody else have this problem?
> To me it seems like a bug in WTE.
> 
> Cheers,
> 
> -hendrik
> 
> Here's the errormessage:
> 
> Error ReportError 500
> An error has occured while processing 
> request:http://localhost:8080/CIC/index.jsp
> Message: Server caught unhandled exception from servlet [jsp]: cant
> remove 
> Attributes from request scope
> 
> Target Servlet: jsp
> StackTrace: 
> 
> Root Error-1: cant remove Attributes from request scope
> 
> java.lang.IllegalArgumentException: cant remove Attributes from
request
> scope
>  java.lang.Throwable(java.lang.String)
>  java.lang.Exception(java.lang.String)
>  java.lang.RuntimeException(java.lang.String)
>  java.lang.IllegalArgumentException(java.lang.String)
>  void
>
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.Stri
> ng, int)
>  int org.apache.struts.taglib.html.FormTag.doEndTag()
>  void
>
_index_xjsp_debug_jspsrc_547983255._jspService(javax.servlet.http.HttpSe
> rvletRequest, javax.servlet.http.HttpServletResponse)
>  void
>
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpSer
> vletRequest, javax.servlet.http.HttpServletResponse)
>  void
> javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
> javax.servlet.ServletResponse)
>  void
>
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.ser
> vlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse,
> boolean)
>  void
>
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.H
> ttpServletRequest, javax.servlet.http.HttpServletResponse,
> java.lang.String, java.lang.Throwable, boolean)
>  void
>
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServ
> letRequest, javax.servlet.http.HttpServletResponse)
>  void
> javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
> javax.servlet.ServletResponse)
>  void
>
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.serv
> let.ServletRequest, javax.servlet.ServletResponse)
>  void
>
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.serv
> let.ServletRequest, javax.servlet.ServletResponse)
>  void
>
com.ibm.servlet.engine.webapp.ServicingServletState.service(com.ibm.serv
> let.engine.webapp.StrictLifecycleServlet,
javax.servlet.ServletRequest,
> javax.servlet.ServletResponse)
>  void
>
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servl
> et.ServletRequest, javax.servlet.ServletResponse)
>  void
>
com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.Serv
> letRequest, javax.servlet.ServletResponse,
> com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
>  void
>
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ib
> m.servlet.engine.webapp.ServletInstanceReference,
> javax.servlet.ServletRequest, javax.servlet.ServletResponse,
> com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
>  void
>
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.se
> rvlet.ServletRequest, javax.servlet.ServletResponse,
> com.ibm.servlet.e

output xml file

2001-05-31 Thread Wu, Ying (LNG-CIS)

I need to send a string which represents a xml file to browser, I need to
call response.setContentType("text/xml").  But it is at ActionServlet level
and is default to "text/html".

1. Any idea?
2. I can do the output at MyAction.perform(, request, response, ) level, but
how to handle the return type of this method?

Thanks.

Ying