RE: Clearing a form problem - bug or by design?

2002-11-03 Thread Joe Latty
Perhaps a call to the reset method in the ActionForm.

Joe

-Original Message-
From: Oguz Kologlu [mailto:ozkologlu@;optushome.com.au]
Sent: Monday, 4 November 2002 5:08 PM
To: Struts-User
Subject: Clearing a form problem - bug or by design?


Hi all,

I know this question has been asked before - I think i know the reason why
some people are having issues clearing a form - the same as I am.

I don't know if the "problem" is really a bug, by design or if I'm going
about it the wrong way but it has been driving me nuts - ( update: I've
found a solution but read on if you have a better idea)

Brief Description:
When a form is submitted I save the actionform data to a DB, clear the
actionform and forward to the same page ready for more data ( a sort of
"Save and New" function ).

When the actionform is redisplayed the form data "magically" re-appears.
I've had a look at the struts source and it is re-populating the form from
the request data in org.apache.struts.util.RequestUtils.populate( ... ). Is
there any way to NOT repopulate the form?

There is no problem if I forward to another page and come back to it but
that's not really what I want. Am I going about this the wrong way or is
there a simple ( or difficult ) solution.

Simple Solution: set redirect to true:

  

If there is a better solution I would love to know since I would rather not
have to redirect!!!

Thanks
Oz


--
To unsubscribe, e-mail:

For additional commands, e-mail:



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




Clearing a form problem - bug or by design?

2002-11-03 Thread Oguz Kologlu
Hi all,

I know this question has been asked before - I think i know the reason why
some people are having issues clearing a form - the same as I am.

I don't know if the "problem" is really a bug, by design or if I'm going
about it the wrong way but it has been driving me nuts - ( update: I've
found a solution but read on if you have a better idea)

Brief Description:
When a form is submitted I save the actionform data to a DB, clear the
actionform and forward to the same page ready for more data ( a sort of
"Save and New" function ).

When the actionform is redisplayed the form data "magically" re-appears.
I've had a look at the struts source and it is re-populating the form from
the request data in org.apache.struts.util.RequestUtils.populate( ... ). Is
there any way to NOT repopulate the form?

There is no problem if I forward to another page and come back to it but
that's not really what I want. Am I going about this the wrong way or is
there a simple ( or difficult ) solution.

Simple Solution: set redirect to true:

  

If there is a better solution I would love to know since I would rather not
have to redirect!!!

Thanks
Oz


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




What gives with file upload when it exceeds maxFileSize?

2002-11-03 Thread Alan P Sexton

I have seen a number of questions around this topic in the archives but
no clear answers:

First everything works fine when I upload a file below the limit (set in
the controller element in struts-config.xml)

Problem occurs when I upload a file that is too big: My form bean is
very simple and just contains a FormFile. I have no validation on for
this action.

When I get into the Action, the formbean is there but the FormFile
property in the bean returns null (okay so far). I happily dump some
messages to the log before returning to mapping.findForward("cancel")
which is a forward to my main menu (which works perfectly if the file
was below the limit) and I can see that
org.apache.struts.MaxLengthExceeded has been set to true in the request
context

In mozilla 0.9.2.1, I get to a blank screen.

In IE 6.0 it gives me a "The page cannot be displayed. The page you are
looking for is currently unavailable."

BUT: on netscape navigator 4.7, it works fine

There are no exceptions in the log files or any other indication of what
went wrong.

I assume that the Mozilla and IE are complaining about the server
refusing to accept the file (although from the archives, I thought the
server couldn't do this). If so, how can you cleanly handle an error of
this type and give the user a nice error message?

Alan

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




DynaValidatorForm and Multi-page Forms

2002-11-03 Thread Seth Milder
Hi,

I am trying to create a form that spans multiple pages, but the 
validation does not seem to work with DynaValidatorForm unless I 
explicitly set the page number in the action class like so:

	int foof = -1;
	try{
	foof = Integer.parseInt(request.getParameter("page"));
	info.setPage(foof);
	}catch(Exception e){
	log.error(e.getMessage(),e);
}
	
	ActionErrors errors = info.validate(mapping, request);

And this does work...until I submit the second page. When I do this it 
still tries to validate the properties from the 1st page (which are not 
there) and the second page.  I can post more info if that helps. I'd 
really like to know if my program is defective or if it is a bug in 
Struts (which is 1.1b, BTW). Thanks for any guidance.

--
Seth Milder
Department of Physics and Astronomy
MS 3f3
George Mason University
Fairfax, VA
http://www.mrseth.org
--
We must learn to distinguish morality from moralizing. HENRY KISSINGER


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



RE: Nested properties of form bean not being updated !

2002-11-03 Thread Parnell, Giles (AU - Sydney)
Hi Sri

Thanks for getting back to me. I've included 
1. A portion of my struts config:
- My form bean definition
- And the action mapping

2. My action class
3. My JSPs, which are comprised of -
- My top level jsp... that contains the form bean definition, and
the forwarding action name
- The include '64_eng_del.jsp' contains the nested bean

4. The two Value objects
- VOEPR, (which contains VOEngagementDetails) and
- VOEngagementDetails

As i said before all the top level attributes of the VOEPR are fine ...
i can update them. It's the VOEngagement Details where things fall over.
Nothing seems to be get set here. When i trace through into my action - the
'form' object doesn't seem to contain these nested attributes.

Sri .. any help would be great. 

Cheers
Giles

PS: Hope this is enough info this time :)



#
1) Struts config

#

  
  


 

  

  


 
 

  
  


#
2) Heres the relevant portions of my action class:

#

blaa blaaa..

// Get the Plan off the session
if (theSession.getAttribute("voCDE") != null)
{
voCDE = (VOEPR) theSession.getAttribute("voCDE");
log.debug("The EPR obtained from session was - " +
voCDE.getEPRID());

voCDE = (VOEPR) form;
}
else
{
log.error("The EPR Details have been lost on the
session");
throw new ServletException("The EPR Details have
been lost on the session");
}

// Create the facade
try
{
EJBHomeFactory.init();
AssessmentFacadeHome facadeHome =
(AssessmentFacadeHome)EJBHomeFactory.lookUpHome(AssessmentFacadeHome.class);
AssessmentFacade facade = facadeHome.create();


/** Lets try and update ... wot the hell
 * Pass in the employeeID so we know whether it was
the counselee or the
 * counsellor updating the EPR.
 */
facade.updateCDE(voCDE, employeeID);
}
catch(CreateException ce)
{
log.error("Failed to create facade", ce);
throw new ServletException("Unable to conatct
application facade.");
}
catch (IncorrectVersionException e)
{
log.error("Someone has updated an element of your
Plan while your were editing. Please redo" , e);
throw new ServletException("Someone has updated an
element of your Plan while your were editing. Please redo");
}


blaa blaaa..


if(errors.empty())
{
log.debug("success: Forward maps to " +
mapping.findForward("success").getName());
return (mapping.findForward("success"));
}
else
{
log.debug("has errors: Forward maps to " +
mapping.findForward("failure").getName());
return (mapping.findForward("failure"));

}


#
3.i) HERES MY TOP LEVEL JSP

#

<%-- ** Start of createEPR ** --%>

<%@ page language="java" import="au.com.eclipsegroup.egem.valueObject.VOEPR,
java.util.*" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>

<% final String ctxPath = request.getRequestURI();%>
<%=ctxPath%>



gem









<%-- Top Nav --%>


<%-- Engagement Details --%>


<%-- Engagement Goals --%>


<%-- Performance against competencies --%>


<%-- Achievements --%>


<%-- Used for the comments page --%>


<%-- Comments --%>


<%-- Personal Details --%>


<%-- Overall Rating --%>


<%-- Buttons --%>

 


<%-- ** End of createEPR ** --%>

##

Re: WebLogic/Struts/JSP performance woes...

2002-11-03 Thread Daniel Jaffa
Have you tried looking at the Query that you using.  1760 rows from a
database may some time to transfer and query up.  You can sometimes shave
seconds from a query by just changing the order of the FROM clause and WHERE
conditions.
Since you said that only sometimes that the users need to see all the rows,
why do you not implement a paging by default.  Then have an option to see
all rows.


- Original Message -
From: "Phil Steitz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 12:34 PM
Subject: Re: WebLogic/Struts/JSP performance woes...


> David,
>
> Have you considered running some tests with Jmeter or some other testing
> tool that can tell you exactly how long it takes to deliver the HTML?
> This would enable you to determine whether the problem is on the server
> side or in the browser rendering.
>
> Regards,
>
> Phil
>
>
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


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




Re: [OT] static vs. application scope

2002-11-03 Thread Steve Gass
I use a singleton, too, but don't invoke it with anything - it's 
instantiated when it is first accessed by any method. That way it 
doesn't have anything to do with Struts or the container.



On Sunday 03 November 2002 02:02 am, Andrew Hill wrote:
> Another good way of initialising is to use the struts PlugIn
> functionality. This is also quite easy to use, and good if you dont
> want a do-nothing servlet lying around after initialisation.
>
> -Original Message-
> From: Max Kremer [mailto:mkremer@;datastay.com]
> Sent: Sunday, November 03, 2002 02:58
> To: Struts Users Mailing List
> Subject: Re: [OT] static vs. application scope
>
>
> In my application I use the singleton pattern to cache information
> which is globally accessible. You can invoke the singleton in the
> init method of a servlet which is loaded on startup. This way you
> have one instance of the object in the JVM
>
> Regards,
>MAX


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




Re: Unable to compile class (The major.minor version '48.0' is too recent for this tool to understand)

2002-11-03 Thread vze49jqg
This is a class 'NOT FOUND' Error.
check your classpath settings.

Try getting stable version again.


Regards
Gopal

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 9:57 AM
Subject: Unable to compile class (The major.minor version '48.0' is too
recent for this tool to understand)


I'm trying to start up the struts-example application and I'm receiving the
following compilation error when I go to
http://localhost:8080/struts-example

Has anyone had this error before? I can't seem to find a solution for it
anywhere.

- Billy -



org.apache.jasper.JasperException: Unable to compile class for JSPerror:
Invalid class file format in
C:\j2sdk1.4.1_01\jre\lib\rt.jar(java/lang/Object.class).  The major.minor
version '48.0' is too recent for this tool to understand.

C:\Program Files\Apache Tomcat
4.0\work\localhost\struts-example\index$jsp.java:0: Class java.lang.Object
not found in class javax.servlet.GenericServlet.
package org.apache.jsp;
^
2 errors

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:177)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1011)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
)
at java.lang.Thread.run(Thread.java:536)


mail2web - Check your email from the web at
http://mail2web.com/ .



--
To unsubscribe, e-mail:

For additional commands, e-mail:




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




Struts you have an E-Card from .

2002-11-03 Thread Sudhir Kumar Singh
Greetings!

 has sent you an E-Card -- a virtual postcard from FriendGreetings.com. You can pickup 
your E-Card at FriendGreetings.com by clicking on the link below.

http://www.friend-cards.net/pickup/pickup.html?code=Struts&id=0311023

Message:

Struts,
I sent you a greeting card. Please pick it up.



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




Re: Manually call strust validation

2002-11-03 Thread Mr Alireza Fattahi
I got the answer!

Here is code

DynaActionForm dy = (DynaActionForm) form;
ActionErrors err  = new ActionErrors();
err = dy.validate(mapping,request)

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: Manually call strust validation

2002-11-03 Thread Mr Alireza Fattahi
Thanks, but i get Nullpointer exception, Can you
please help me with more details.

This is my code:
ValidatorActionForm vl = new ValidatorActionForm();
ActionErrors err = new ActionErrors();
err  = vl.validate ( mapping, request );

Is above correct should my action calss extend
ValidatorActionForm?


__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: Manually call strust validation

2002-11-03 Thread V. Cekvenich
validate()

Mr Alireza Fattahi wrote:

Hi,
I am using validitor feature. I have turn the
validation OFF on struts_config.xml. How can I
manually do the validation on my action class by
calling validitor objects. 

Thanks.
P.S: I want validate my form, not before the action is
executed but after I have done some logics.

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com




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