Upload File question

2003-11-15 Thread Indra Gunawan
Hello,

I am using a multipart form that contains form data and one input type file
to upload data  I also write a servlet to capture those values , but
strange ... not all form data captured and the stream from input type file
is available ... 

Can I use that combination ? Or should I separate the form data part and
input type file part in another form ... for example popup ...

But if there is a way , I prefer to combine them :)

Thanks

Indra 

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



New element causes 503 error

2003-11-15 Thread todd thorner
Hi,

I just tried to add a  element to my Struts-based webapp.  I put the 
proper syntax into my struts-config.xml file, my web.xml file, my 
%TOMCAT_HOME%/conf/server.xml file and I put mysql-connector-java-3.0.9-stable-bin.jar 
into %TOMCAT_HOME%/common/lib (nowhere else).

Now when I restart Tomcat (4.1.x), my webapp disappears altogether ("503 - Servlet 
action is currently unavailable ").

What's up with that?  I didn't change anything, just added some new lines for the new 
DataSource.

Thanks for any suggestions or guesses.  The pertinent code is posted below.

---

New addition to server.xml:


  
factory
org.apache.commons.dbcp.BasicDataSourceFactory
  
  
url
jdbc:mysql://mysql:3306/mydomain?autoReconnect=true
  
  
driverClassName
org.gjt.mm.mysql.Driver
  
  
username
mydomain
  
  
password

  
  
removeAbandoned
true
  
  
removeAbandonedTimeout 
90
  
  
logAbandoned
true
  



New addition to WEB-INF/web.xml:


  
jdbc/mydomainDB
  
  
javax.sql.DataSource
  
  
Container
  



New addition to struts-config.xml:


  







  


---

Also, I do not see anything extraordinary within the "localhost" log (what setting do 
I change to make this log print more verbose info?).  My Tomcat startup log says:

...
Nov 15, 2003 6:06:56 AM org.apache.struts.action.ActionServlet initModuleDataSources
SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
java.lang.InstantiationException: javax.sql.DataSource
at java.lang.Class.newInstance0(Class.java:293)
at java.lang.Class.newInstance(Class.java:261)
at 
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
at 
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1081)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3609)
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:2190)
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)
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 ngasi.CustomAppserverLoader.main(Unknown Source)
Nov 15, 2003 6:06:57 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:4601
Nov 15, 2003 6:06:57 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/48  
config=/usr/ngasi/contexts/porturla/appservers/jakarta-tomcat-4.1.27/conf/jk2.properties

---

Thanks again.



Enter now for a chance to win a 42" Plasma Television!
http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda1.com/1/c/563632/113422/313631/313631
AOL users go here: 
http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda1.com/1/c/563632/113422/313631/313631
This offer applies to U.S. Residents Only

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



Re: Typical edit page

2003-11-15 Thread Richard Yee
Mohd,
No. Struts does not do anything with any of the static parts of your page. 
Why can't you use the html:text tag? You can put a JSP or JSTL expression 
as the value of the 'value' attribute too.



-Richard

At 01:37 AM 11/15/2003, you wrote:
Thanks for your help

there is a situation where i cant use  to render a text input, 
i use normal html tag , is struts will know to display the values 
inside a normal  tag?

Richard Yee wrote:

Mohd,
You need to retrieve the user's current settings and set the appropriate 
fields in your ActionForm from your Action class. If you do that, the 
fields will be populated when you display the form. Are you 
using  html:select  with html:options ? You might want to look at the 
html:optionsCollection tag too.

-Richard

At 06:56 PM 11/14/2003, you wrote:

hi

is there any automatic way that i can polulate all the fields (including 
html:select with html:options) in a typical edit/update page? coz right 
now im doing it manually. & im basically stuck when try to select the 
option saved previously. im using html:options with the labelValueBean

any help is greatly appreciated

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


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


Where to get the latest Scaffold jar and documentation?

2003-11-15 Thread ZYD
 I downloaded a file called scaffold-lib_1_1_b1.zip, there are two jar files inside:
 commons-scaffold.jar and struts-scaffold.jar
 
 In Struts in Action, page 434, org.apache.scaffold.text.MessageUtils is metioned.
 Does anybody knows where is it?
 It's not in the two jar files above. I cannot find it anywhere. Even 
jakarta.apache.org .
 
 I also searched the net using google, still no answer.
 
 If you are using Scaffold, please give me some help, thanks in advance.
 
 bruce
 
 BTW: Is Scaffold still being actively maintained and updated?

Re: Can't store object in request from an action

2003-11-15 Thread Max Cooper
If the request arrives at the JSP from the input attribute on the action
mapping due to a validation error (from calling validate() on the
ActionForm), the action is not part of the processing loop. Struts calls
validate() and then forwards the request directly to the input JSP if a
validation error is encountered.

If there is no validation error occurring, it may be that you have the
redirect attribute of the forward set to true, which results in the action
processing the request and sending a redirect to the JSP, and then the
browser requests the JSP directly, which will be a new request (and thus
anything you put in the request in the action won't be visible to the JSP).
If the URL in the browser window shows the JSP's URL (instead of the Action
URL) at this point, that is what is happening.

-Max

- Original Message - 
From: "Bessette" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, November 14, 2003 10:31 PM
Subject: RE: Can't store object in request from an action


> I know that's not the issue, because I also print out all of the request
> keys and their objects.
>
> The main purpose behind this is getting the ActionErrors and
ActionMessages
> to work properly.  I use saveErrors and saveMessages, but the
>  tag doesn't display anything.
>
> If anyone has any insights, they'd be very appreciated.
>
> Thanks,
> Eric
>
> -Original Message-
> From: Richard Yee [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 14, 2003 9:21 PM
> To: Struts Users Mailing List
> Subject: Re: Can't store object in request from an action
>
>
> Try this instead:
>
> ...
> <%= request.getAttribute( "testing" ) %>
> ...
>
> -Richard
>
>
> At 07:38 PM 11/14/2003, you wrote:
> >I'm trying to set an attribute in the request scope from an action.
> >However, when I do the following:
> >
> >...
> >public ActionForward execute(
> > ActionMapping mapping,
> > ActionForm form,
> > HttpServletRequest request,
> > HttpServletResponse response)
> > throws Exception {
> >
> > request.setAttribute( "testing", "This is a test" );
> > return mapping.getInputForward();
> >}
> >...
> >
> >and in my jsp page, I do:
> >
> >...
> ><%= pageContext.findAttribute( "testing" ) %>
> >...
> >
> >
> >I always get null.  Is the request sent to the execute statement the same
> >one used for the forward?  Could this be because I want to forward to the
> >input jsp?  Please, please help me out.  I've been spinning my wheels for
a
> >few days now trying to figure this out.
> >
> >Thanks,
> >Eric
> >
> >
> >-
> >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]



struts 1.1 validation problem / question

2003-11-15 Thread Andreas Wuest
Hi,

i have a small problem / question concerning the struts 1.1 validation.
i have a jsp form that has the following input fields : 

id
name
password
userAction

Depending on the userAction value (can be 'show' or 'save') i need to 
validate only the id (when userAction is 'show') or the name, password
and id (when the userAction is 'save').
i have one form that contains the 4 properties (with getters and setters)
and an action class that handles the show and the save action. 

the problem that i have is the validation. as far as i understand the 
docuemtneation it is not possible to validate a property only when
another property has a certain value. in other words it is not possible
to tell the validator to skip validation of a property when another property
has a certain value. 
or am i mistaken ?

how can i solve this problem ? do i need 2 forms and action to handle the
different userActions or is there another way ??

Thanks in advance,

 Andreas 


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



nested indexed property Javascript

2003-11-15 Thread sumeet sharma
Hi,
   Has anyone used nested indexed property ? As I am unable to make any javascript 
call on such a property .
My validation.xml entery is as follows

  
 
  



My form has voclass property. The voclass has an arraylist of arlLocations having 
collection of bean Locations .
The Loctaions has Date property which has to be validated .
Both server and client side ...Has any one encountered such a condition!!!

Thanks in advance.

Regards,
Sumeet



RE: torque 3.0 vs. torque 3.1

2003-11-15 Thread Amine Bousta
Hello,

I think you are in the wrong list because there is a Torque user list than
can help you in this way.
For your pb, be sure you have downloaded the torque-3.1.zip (for execution)
and the torque-3.1-gen.zip for generation.
>From the 3.1 version, Torque separated execution and generation into two
files. You might find the missing files in the torque-3.1-gen.zip

Regards


-Message d'origine-
De : news [mailto:[EMAIL PROTECTED] la part de Dominique Kraus-Ahma
Envoyé : samedi 15 novembre 2003 09:12
À : [EMAIL PROTECTED]
Objet : torque 3.0 vs. torque 3.1


Hi,

i am trying to get torque 3.1 running. Since i am quit new to persistent
frameworks i fugured that i just had no clue of how to get it to work.
But now i start getting confused about the distribution.

I downloaded the zip-file from
http://jakarta.apache.org/builds/jakarta-turbine/torque/release/3.1/, but
obviously, the tree structure is different from version 3.0. I am missing
/schema, besides i can't find the build-torque.xml.

The only thing, version 3.1 offers, is a quit nice build.xml  to generate a
properties-file for torque. But that's all, IMHO!

Is there something wrong with the 3.1 zip-Distribution of torque? Or am i
just very, very tired from sitting in front of my computer?

Regards,
Dominique




-
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: Typical edit page

2003-11-15 Thread Mohd Fadhly
Thanks for your help

there is a situation where i cant use  to render a text 
input, i use normal html tag , is struts will know to display the 
values inside a normal  tag?

Richard Yee wrote:

Mohd,
You need to retrieve the user's current settings and set the 
appropriate fields in your ActionForm from your Action class. If you 
do that, the fields will be populated when you display the form. Are 
you using  html:select  with html:options ? You might want to look at 
the html:optionsCollection tag too.

-Richard

At 06:56 PM 11/14/2003, you wrote:

hi

is there any automatic way that i can polulate all the fields 
(including html:select with html:options) in a typical edit/update 
page? coz right now im doing it manually. & im basically stuck when 
try to select the option saved previously. im using html:options with 
the labelValueBean

any help is greatly appreciated

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


Disabling

2003-11-15 Thread Mohd Fadhly
hi,

is there someway that we can enable/disable or set some properties of 
form input like  from the Action class?

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


torque 3.0 vs. torque 3.1

2003-11-15 Thread Dominique Kraus-Ahma
Hi,

i am trying to get torque 3.1 running. Since i am quit new to persistent
frameworks i fugured that i just had no clue of how to get it to work.
But now i start getting confused about the distribution.

I downloaded the zip-file from
http://jakarta.apache.org/builds/jakarta-turbine/torque/release/3.1/, but
obviously, the tree structure is different from version 3.0. I am missing
/schema, besides i can't find the build-torque.xml.

The only thing, version 3.1 offers, is a quit nice build.xml  to generate a
properties-file for torque. But that's all, IMHO!

Is there something wrong with the 3.1 zip-Distribution of torque? Or am i
just very, very tired from sitting in front of my computer?

Regards,
Dominique




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