common-digester.jar conflict when usings Struts with Jasper Reports

2005-09-29 Thread Kashif Inam
Hi


I am working on a web application with Struts and Jasper Reports.
Jasper Reports requires common-digester.1.7.jar ( that is a latest version of 
struts's common-digester.jar), when i use this file, i get the following  
exceptions 

javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans 
collection  at org.apache.struts.taglib.html.FormTag.lookup
(FormTag.java:798)  at org.apache.struts.taglib.html.FormTag.doStartTag
(FormTag.java:506)  at _index._jspService(_index.java:53)   


If i use common-digester.jar (struts version, older one)..then my Jasper 
Reports throws following exception..


java.lang.NoClassDefFoundError: 
org/apache/commons/digester/SetNestedPropertiesRule at 
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:200)  at 
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:165)  at 
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:149)  at 
com.netsol.pms.reports.ReportManager.buildReport(ReportManager.java:210)
at com.netsol.pms.reports.ReportManager.getPreview
(ReportManager.java:184)

Please suggest me how can i resolve this conflict..

thanks & Regards
Kashif Inam




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



Re: ValidWhen and string comparison

2005-09-29 Thread Emmanuel.Leguy

Niall Pemberton a écrit :


What you have should work - but its always going to give an error unless
statut is set to "Doctorant".
 


Yes! It's what i want.


Are you sure "statut" is in your bean and getting populated?
 

Yes, because when the error happen (every time with any "statut" value) 
i display errors () and the same form with the values the 
user entered. And the value of statut is what the user gave. Acording to 
me, that means that the form bean (and "statut") is populated with the 
user values.
If i suppress the validwhen rule, the action is able to get the "statut" 
value.


Thanx,

Manu.


--
Emmanuel Leguy  LIFL - UMR8022 CNRS - Bat M3
Tel: +33 3 28 77 85 32  USTL - Universite de Lille 1
Fax: +33 3 28 77 85 37  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE

mailto:[EMAIL PROTECTED]
http://www.lifl.fr/ANNUAIRE/employee.php?login=leguye

Ce mail est signe par un certificat X509 fourni par le CNRS
La verification de ce certificat peut etre faite a l'adresse suivante: 
http://igc.services.cnrs.fr/CNRS-Standard/recherche.html 



smime.p7s
Description: S/MIME Cryptographic Signature


Re: ValidWhen and string comparison

2005-09-29 Thread Emmanuel.Leguy

My problem is fixed!

It was a stupid mistake. Excuse me for disturbing the list but the 
discussion opened my eyes. The type of statut was String[] and not 
String :-[ . So, I have a brand new question: how to valid "financement" 
when one of the value of "statut" is set to "Doctorant"? Is validwhen 
powerfull enough to do that?


Thanx,

Manu.

Emmanuel.Leguy a écrit :


Niall Pemberton a écrit :


What you have should work - but its always going to give an error unless
statut is set to "Doctorant".
 


Yes! It's what i want.


Are you sure "statut" is in your bean and getting populated?
 

Yes, because when the error happen (every time with any "statut" 
value) i display errors () and the same form with the 
values the user entered. And the value of statut is what the user 
gave. Acording to me, that means that the form bean (and "statut") is 
populated with the user values.
If i suppress the validwhen rule, the action is able to get the 
"statut" value.


Thanx,

Manu.





--
Emmanuel Leguy  LIFL - UMR8022 CNRS - Bat M3
Tel: +33 3 28 77 85 32  USTL - Universite de Lille 1
Fax: +33 3 28 77 85 37  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE

mailto:[EMAIL PROTECTED]
http://www.lifl.fr/ANNUAIRE/employee.php?login=leguye

Ce mail est signe par un certificat X509 fourni par le CNRS
La verification de ce certificat peut etre faite a l'adresse suivante: 
http://igc.services.cnrs.fr/CNRS-Standard/recherche.html 



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Looking for a table library

2005-09-29 Thread 梁炳場
In addition datagrid and displaytag, is struts-layout a widely used tool?

Any other open source tools to display a grid or something like this?

Thnx


2005/9/27, David G. Friedman <[EMAIL PROTECTED]>:
> How about the Pager Taglib from JSPtags.com? Their examples show radio
> buttons to get the 'editable table' concept across.
> http://jsptags.com/tags/navigation/pager/index.jsp
>
> Or the Jakarta "DataGrig" taglib from their taglib Sandbox.  Their nightly
> build has some sharp examples of paging with clickable buttons.
> http://cvs.apache.org/builds/jakarta-taglibs-sandbox/nightly/projects/datagr
> id/
> http://jakarta.apache.org/taglibs/sandbox/doc/datagrid-doc/intro.html
>
> Regards,
> David
>
> -Original Message-
> From: R. Markham [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 26, 2005 12:22 PM
> To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Subject: AW: Looking for a table library
>
>
> Hi Martin,
>
> I don't find a way how to put input (Text, CheckBox or RadioButton) in a
> column. It seems to me that I only can use the cells as output string. I
> already use the table of http://www.displaytag.org) in my Application but I
> am looking how to put a checkbox in a cell.
>
> Regards
>
> Richard Markhham.
>
> -Ursprüngliche Nachricht-
> Von: Martin Kindler [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 26. September 2005 15:25
> An: 'Struts Users Mailing List'
> Betreff: AW: Looking for a table library
>
> Richard,
>
> take a look at the Displaytag library (http://www.displaytag.org).
>
> Martin
>
> > -Ursprüngliche Nachricht-
> > Von: R. Markham [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 26. September 2005 15:14
> > An: 'Struts Users Mailing List'
> > Betreff: Looking for a table library
> >
> > Hi all,
> >
> > I have a table in my jsp. To be able to process the data of a
> > row in a table I want to be able to mark a row in the table
> > and read the content of the row,  through the row number of
> > marked line. I think this a very common problem, somewhere
> > there must be a solution for this problem.
> >
> > TIA
> > Richard Markham
>
>
> -
> 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]



prepopulating jsp page

2005-09-29 Thread faisal.shoukat
Hi,
 
I am trying to pre-populate my JSP page with the values returned from
the database when a user edits a client. I have just recently upgraded
to Struts download 1.2.4.  
 
This is what I did before which worked: 
 
In my action class I created the form  then populated it with the values
from the DB.
 
CreateClientForm updateForm = new CreateClientForm();
 
 
My struts config sent the response to the jsp page where I displayed the
values as follows
 

 
However in this new download the html tag library does not have a tag
for name.  Thus I cannot add the name tag to the html:form tag.
 
So my jsp now looks ike this:
 

 
and my struts config.xml :
 




 
Can anyone please advise what I need to do to get these values into the
jsp page as it appears empty.  How do I get around this name tag?
 
Thanks
 


Re: prepopulating jsp page

2005-09-29 Thread Cedric Levieux

Hi,

Did you put the new form into session or into 
whatever-the-scope-of-the-form-must-be ?

If not, the error may come from that

Regards,

Cedric

[EMAIL PROTECTED] wrote:


Hi,

I am trying to pre-populate my JSP page with the values returned from
the database when a user edits a client. I have just recently upgraded
to Struts download 1.2.4.  

This is what I did before which worked: 


In my action class I created the form  then populated it with the values
from the DB.

CreateClientForm updateForm = new CreateClientForm();


My struts config sent the response to the jsp page where I displayed the
values as follows



However in this new download the html tag library does not have a tag
for name.  Thus I cannot add the name tag to the html:form tag.

So my jsp now looks ike this:



and my struts config.xml :


   
   
   

Can anyone please advise what I need to do to get these values into the
jsp page as it appears empty.  How do I get around this name tag?

Thanks


 




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



SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT


> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:26
> Till: user@struts.apache.org
> Ämne: prepopulating jsp page
> 
> Hi,
>  
> I am trying to pre-populate my JSP page with the values returned from
> the database when a user edits a client. I have just recently upgraded
> to Struts download 1.2.4.  
>  
> This is what I did before which worked: 
>  
> In my action class I created the form  then populated it with 
> the values
> from the DB.
>  
> CreateClientForm updateForm = new CreateClientForm();

Do this in your action:

   CreateClientForm updateForm = new CreateClientForm();
   // populate the bean here

   // then
   form = updateForm;


>  
>  
> My struts config sent the response to the jsp page where I 
> displayed the
> values as follows
>  
>name="createClientForm"
>   type="com.medina.web.forms.CreateClientForm">
>  
> However in this new download the html tag library does not have a tag
> for name.  Thus I cannot add the name tag to the html:form tag.
>  
> So my jsp now looks ike this:
>  
> 
>  
> and my struts config.xml :
>  
>  type="com.medina.web.action.UpdateClientAction"
> name="createClientForm"
> scope="session"
> parameter="update"
> input="/editClient.jsp">
> 
> 
> 
>  
> Can anyone please advise what I need to do to get these 
> values into the
> jsp page as it appears empty.  How do I get around this name tag?
>  
> Thanks
>  
> 

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



RE: prepopulating jsp page

2005-09-29 Thread faisal.shoukat
Do this in your action:

   CreateClientForm updateForm = new CreateClientForm();
   // populate the bean here

   // then
   form = updateForm;

When you say 

form = updateForm;

what is my variable form of type?




-Original Message-
From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 10:34
To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page



> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:26
> Till: user@struts.apache.org
> Ämne: prepopulating jsp page
> 
> Hi,
>  
> I am trying to pre-populate my JSP page with the values returned from
> the database when a user edits a client. I have just recently upgraded
> to Struts download 1.2.4.  
>  
> This is what I did before which worked: 
>  
> In my action class I created the form  then populated it with 
> the values
> from the DB.
>  
> CreateClientForm updateForm = new CreateClientForm();

Do this in your action:

   CreateClientForm updateForm = new CreateClientForm();
   // populate the bean here

   // then
   form = updateForm;


>  
>  
> My struts config sent the response to the jsp page where I 
> displayed the
> values as follows
>  
>name="createClientForm"
>   type="com.medina.web.forms.CreateClientForm">
>  
> However in this new download the html tag library does not have a tag
> for name.  Thus I cannot add the name tag to the html:form tag.
>  
> So my jsp now looks ike this:
>  
> 
>  
> and my struts config.xml :
>  
>  type="com.medina.web.action.UpdateClientAction"
> name="createClientForm"
> scope="session"
> parameter="update"
> input="/editClient.jsp">
> 
> 
> 
>  
> Can anyone please advise what I need to do to get these 
> values into the
> jsp page as it appears empty.  How do I get around this name tag?
>  
> Thanks
>  
> 

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



SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT


> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:38
> Till: user@struts.apache.org
> Ämne: RE: prepopulating jsp page
> 
> Do this in your action:
> 
>CreateClientForm updateForm = new CreateClientForm();
>// populate the bean here
> 
>// then
>form = updateForm;
> 
> When you say 
> 
> form = updateForm;
> 
> what is my variable form of type?

  Form is the variable you got in your actions execute method:

public ActionForward execute(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws Exception 


> 
> 
> 
> 
> -Original Message-
> From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Sent: 29 September 2005 10:34
> To: 'Struts Users Mailing List'
> Subject: SV: prepopulating jsp page
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:26
> > Till: user@struts.apache.org
> > Ämne: prepopulating jsp page
> > 
> > Hi,
> >  
> > I am trying to pre-populate my JSP page with the values 
> returned from
> > the database when a user edits a client. I have just 
> recently upgraded
> > to Struts download 1.2.4.  
> >  
> > This is what I did before which worked: 
> >  
> > In my action class I created the form  then populated it with 
> > the values
> > from the DB.
> >  
> > CreateClientForm updateForm = new CreateClientForm();
> 
> Do this in your action:
> 
>CreateClientForm updateForm = new CreateClientForm();
>// populate the bean here
> 
>// then
>form = updateForm;
> 
> 
> >  
> >  
> > My struts config sent the response to the jsp page where I 
> > displayed the
> > values as follows
> >  
> >  >   name="createClientForm"
> >   type="com.medina.web.forms.CreateClientForm">
> >  
> > However in this new download the html tag library does not 
> have a tag
> > for name.  Thus I cannot add the name tag to the html:form tag.
> >  
> > So my jsp now looks ike this:
> >  
> > 
> >  
> > and my struts config.xml :
> >  
> >  > type="com.medina.web.action.UpdateClientAction"
> > name="createClientForm"
> > scope="session"
> > parameter="update"
> > input="/editClient.jsp">
> > 
> > 
> > 
> >  
> > Can anyone please advise what I need to do to get these 
> > values into the
> > jsp page as it appears empty.  How do I get around this name tag?
> >  
> > Thanks
> >  
> > 
> 
> -
> 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: Debugging

2005-09-29 Thread Swapnil Patil
Hi Bryon,

I had used once log4j with Tomcat server.

You can give absolute path for log file in log4j.properties.. like



log4j.appender.struts.File=d:/MyApplicationLogs/struts.log

so atleast you don't need to find log file .
swapnil Patil


On 9/28/05, Borislav Sabev <[EMAIL PROTECTED]> wrote:
>
> Bryon Lape wrote:
>
> >>Bryon Lape wrote:
> >>
> >>
> >>
> >>>I am looking for good pointers on getting debug logging turned on in
> >>>Struts. I've added debug and detail params to my web.xml file, but I
> get
> >>>nothing. Do I need log4j? In the Struts Cookbook I've found some things
> >>>on debugging, but it seems very complex to configure. Is this correct?
> >>>Is getting debug logging on a comples issue?
> >>>
> >>>
> >>>-
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>I hope this could help you:
> >>1. get log4j and put it together with other jars of your web project
> >>2. create a log4j.properties file and put on the root of your web app.
> >>3. add following lines in log4j.properties
> >>
> >>log4j.rootLogger=error,stdout
> >>log4j.logger.org.apache.struts=debug,struts
> >>
> >>log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> >>log4j.appender.stdout.Target=System.out
> >>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> >>log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L
> >>- %m%n
> >>
> >>log4j.appender.struts=org.apache.log4j.RollingFileAppender
> >>log4j.appender.struts.File=struts.log
> >>log4j.appender.struts.MaxFileSize=1000KB
> >>log4j.appender.struts.MaxBackupIndex=5
> >>log4j.appender.struts.layout=org.apache.log4j.PatternLayout
> >>log4j.appender.struts.layout.ConversionPattern=SRTUST: %d %5p %c{1}:%L -
> >>%m%n
> >>
> >>log4j.appender.struts=org.apache.log4j.ConsoleAppender
> >>log4j.appender.struts.Target=System.out
> >>log4j.appender.struts.layout=org.apache.log4j.PatternLayout
> >>log4j.appender.struts.layout.ConversionPattern=STRUTS: %d{ABSOLUTE} %5p
> >>%c{1}:%L - %m%n
> >>
> >>
> >>
> >
> >
> >Ok, I did this, but where is the logging going?
> >
> >
> sorry, forgot to tell you
> first appender obviously writes in a file - so depends how your server
> is started ...
> for example if I start the server useing eclipse IDE- files are in the
> the home dir of eclipse
> if it started from console - in the current dir.
> I still don't know how to manage the files to be written in specified
> location ...
> but the second appender is Console Apennder so it should appear in your
> system console.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Thanks & Regards
Swapnil Patil.


SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT
I seen to be very fast and erronous today, try this:



public ActionForward execute(
  ActionMapping actionMapping,
  AtionForm actionForm, 
  HttpServletRequest httpServletRequest,
  HttpServletResponse httpServletResponse) throws Exception 
 
  CreateClientForm updateForm = (CreateClientForm)actionForm;

  // populate the bean here
  updateForm.setXXX( );
  updateForm.setYYY( );



> -Ursprungligt meddelande-
> Från: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:41
> Till: 'Struts Users Mailing List'
> Ämne: SV: prepopulating jsp page
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:38
> > Till: user@struts.apache.org
> > Ämne: RE: prepopulating jsp page
> > 
> > Do this in your action:
> > 
> >CreateClientForm updateForm = new CreateClientForm();
> >// populate the bean here
> > 
> >// then
> >form = updateForm;
> > 
> > When you say 
> > 
> > form = updateForm;
> > 
> > what is my variable form of type?
> 
>   Form is the variable you got in your actions execute method:
> 
> public ActionForward execute(ActionMapping actionMapping, 
> ActionForm
> actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
> httpServletResponse) throws Exception 
> 
> 
> > 
> > 
> > 
> > 
> > -Original Message-
> > From: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Sent: 29 September 2005 10:34
> > To: 'Struts Users Mailing List'
> > Subject: SV: prepopulating jsp page
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:26
> > > Till: user@struts.apache.org
> > > Ämne: prepopulating jsp page
> > > 
> > > Hi,
> > >  
> > > I am trying to pre-populate my JSP page with the values 
> > returned from
> > > the database when a user edits a client. I have just 
> > recently upgraded
> > > to Struts download 1.2.4.  
> > >  
> > > This is what I did before which worked: 
> > >  
> > > In my action class I created the form  then populated it with 
> > > the values
> > > from the DB.
> > >  
> > > CreateClientForm updateForm = new CreateClientForm();
> > 
> > Do this in your action:
> > 
> >CreateClientForm updateForm = new CreateClientForm();
> >// populate the bean here
> > 
> >// then
> >form = updateForm;
> > 
> > 
> > >  
> > >  
> > > My struts config sent the response to the jsp page where I 
> > > displayed the
> > > values as follows
> > >  
> > >  > >   name="createClientForm"
> > >   type="com.medina.web.forms.CreateClientForm">
> > >  
> > > However in this new download the html tag library does not 
> > have a tag
> > > for name.  Thus I cannot add the name tag to the html:form tag.
> > >  
> > > So my jsp now looks ike this:
> > >  
> > > 
> > >  
> > > and my struts config.xml :
> > >  
> > >  > > type="com.medina.web.action.UpdateClientAction"
> > > name="createClientForm"
> > > scope="session"
> > > parameter="update"
> > > input="/editClient.jsp">
> > > 
> > > 
> > > 
> > >  
> > > Can anyone please advise what I need to do to get these 
> > > values into the
> > > jsp page as it appears empty.  How do I get around this name tag?
> > >  
> > > Thanks
> > >  
> > > 
> > 
> > 
> -
> > 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]



RE: prepopulating jsp page

2005-09-29 Thread Vijaya S
In your struts-config.xml, add a
 section



Then in your action,
if (form != null)
{
   localvariable = (CreateClientForm)form
}
now you can build your form bean properties as localvariable.set metods.

Vijaya


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 2:56 PM
To: user@struts.apache.org
Subject: prepopulating jsp page


Hi,

I am trying to pre-populate my JSP page with the values returned from
the database when a user edits a client. I have just recently upgraded
to Struts download 1.2.4.

This is what I did before which worked:

In my action class I created the form  then populated it with the values
from the DB.

CreateClientForm updateForm = new CreateClientForm();


My struts config sent the response to the jsp page where I displayed the
values as follows



However in this new download the html tag library does not have a tag
for name.  Thus I cannot add the name tag to the html:form tag.

So my jsp now looks ike this:



and my struts config.xml :






Can anyone please advise what I need to do to get these values into the
jsp page as it appears empty.  How do I get around this name tag?

Thanks




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



RE: prepopulating jsp page

2005-09-29 Thread faisal.shoukat
I cannot do the following 

CreateClientForm updateForm = (CreateClientForm)actionForm;

Because the action is called from a search page and has a different form coming 
in.  Thus when I try to reassign it I get a class cast exception.

I also tried the first way you mentioned, but that did not populate the form 
either.


-Original Message-
From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 10:46
To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page

I seen to be very fast and erronous today, try this:



public ActionForward execute(
  ActionMapping actionMapping,
  AtionForm actionForm, 
  HttpServletRequest httpServletRequest,
  HttpServletResponse httpServletResponse) throws Exception 
 
  CreateClientForm updateForm = (CreateClientForm)actionForm;

  // populate the bean here
  updateForm.setXXX( );
  updateForm.setYYY( );



> -Ursprungligt meddelande-
> Från: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:41
> Till: 'Struts Users Mailing List'
> Ämne: SV: prepopulating jsp page
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:38
> > Till: user@struts.apache.org
> > Ämne: RE: prepopulating jsp page
> > 
> > Do this in your action:
> > 
> >CreateClientForm updateForm = new CreateClientForm();
> >// populate the bean here
> > 
> >// then
> >form = updateForm;
> > 
> > When you say 
> > 
> > form = updateForm;
> > 
> > what is my variable form of type?
> 
>   Form is the variable you got in your actions execute method:
> 
> public ActionForward execute(ActionMapping actionMapping, 
> ActionForm
> actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
> httpServletResponse) throws Exception 
> 
> 
> > 
> > 
> > 
> > 
> > -Original Message-
> > From: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Sent: 29 September 2005 10:34
> > To: 'Struts Users Mailing List'
> > Subject: SV: prepopulating jsp page
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:26
> > > Till: user@struts.apache.org
> > > Ämne: prepopulating jsp page
> > > 
> > > Hi,
> > >  
> > > I am trying to pre-populate my JSP page with the values 
> > returned from
> > > the database when a user edits a client. I have just 
> > recently upgraded
> > > to Struts download 1.2.4.  
> > >  
> > > This is what I did before which worked: 
> > >  
> > > In my action class I created the form  then populated it with 
> > > the values
> > > from the DB.
> > >  
> > > CreateClientForm updateForm = new CreateClientForm();
> > 
> > Do this in your action:
> > 
> >CreateClientForm updateForm = new CreateClientForm();
> >// populate the bean here
> > 
> >// then
> >form = updateForm;
> > 
> > 
> > >  
> > >  
> > > My struts config sent the response to the jsp page where I 
> > > displayed the
> > > values as follows
> > >  
> > >  > >   name="createClientForm"
> > >   type="com.medina.web.forms.CreateClientForm">
> > >  
> > > However in this new download the html tag library does not 
> > have a tag
> > > for name.  Thus I cannot add the name tag to the html:form tag.
> > >  
> > > So my jsp now looks ike this:
> > >  
> > > 
> > >  
> > > and my struts config.xml :
> > >  
> > >  > > type="com.medina.web.action.UpdateClientAction"
> > > name="createClientForm"
> > > scope="session"
> > > parameter="update"
> > > input="/editClient.jsp">
> > > 
> > > 
> > > 
> > >  
> > > Can anyone please advise what I need to do to get these 
> > > values into the
> > > jsp page as it appears empty.  How do I get around this name tag?
> > >  
> > > Thanks
> > >  
> > > 
> > 
> > 
> -
> > 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]


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



RE: prepopulating jsp page

2005-09-29 Thread faisal.shoukat
Again doing this I think will throw a class cast exception.

localvariable = (CreateClientForm)form

I already have the form beans elements in my config.xml

-Original Message-
From: Vijaya S [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 10:49
To: Struts Users Mailing List
Subject: RE: prepopulating jsp page

In your struts-config.xml, add a
 section



Then in your action,
if (form != null)
{
   localvariable = (CreateClientForm)form
}
now you can build your form bean properties as localvariable.set metods.

Vijaya


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 2:56 PM
To: user@struts.apache.org
Subject: prepopulating jsp page


Hi,

I am trying to pre-populate my JSP page with the values returned from
the database when a user edits a client. I have just recently upgraded
to Struts download 1.2.4.

This is what I did before which worked:

In my action class I created the form  then populated it with the values
from the DB.

CreateClientForm updateForm = new CreateClientForm();


My struts config sent the response to the jsp page where I displayed the
values as follows



However in this new download the html tag library does not have a tag
for name.  Thus I cannot add the name tag to the html:form tag.

So my jsp now looks ike this:



and my struts config.xml :






Can anyone please advise what I need to do to get these values into the
jsp page as it appears empty.  How do I get around this name tag?

Thanks




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



SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT
Ok, so you  have a different formbean coming in to this action:

> > > >  > > > type="com.medina.web.action.UpdateClientAction"
> > > > name="createClientForm"
> > > > scope="session"

The bean named createClientForm is NOT of class CreateClientForm?

If you have a bean class other than the one mapped to the executing action
that you want to populate and later display in the success-form, then you
have to:

1 create the bean
2 populate it
3 put it in page/request/session scope
4 return from action
5 in jsp, get the bean from the scope you put it in


> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:55
> Till: user@struts.apache.org
> Ämne: RE: prepopulating jsp page
> 
> I cannot do the following 
> 
> CreateClientForm updateForm = (CreateClientForm)actionForm;
> 
> Because the action is called from a search page and has a 
> different form coming in.  Thus when I try to reassign it I 
> get a class cast exception.
> 
> I also tried the first way you mentioned, but that did not 
> populate the form either.
> 
> 
> -Original Message-
> From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Sent: 29 September 2005 10:46
> To: 'Struts Users Mailing List'
> Subject: SV: prepopulating jsp page
> 
> I seen to be very fast and erronous today, try this:
> 
> 
> 
> public ActionForward execute(
>   ActionMapping actionMapping,
>   AtionForm actionForm, 
>   HttpServletRequest httpServletRequest,
>   HttpServletResponse httpServletResponse) throws Exception 
>  
>   CreateClientForm updateForm = (CreateClientForm)actionForm;
> 
>   // populate the bean here
>   updateForm.setXXX( );
>   updateForm.setYYY( );
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:41
> > Till: 'Struts Users Mailing List'
> > Ämne: SV: prepopulating jsp page
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:38
> > > Till: user@struts.apache.org
> > > Ämne: RE: prepopulating jsp page
> > > 
> > > Do this in your action:
> > > 
> > >CreateClientForm updateForm = new CreateClientForm();
> > >// populate the bean here
> > > 
> > >// then
> > >form = updateForm;
> > > 
> > > When you say 
> > > 
> > > form = updateForm;
> > > 
> > > what is my variable form of type?
> > 
> >   Form is the variable you got in your actions execute method:
> > 
> > public ActionForward execute(ActionMapping actionMapping, 
> > ActionForm
> > actionForm, HttpServletRequest httpServletRequest, 
> HttpServletResponse
> > httpServletResponse) throws Exception 
> > 
> > 
> > > 
> > > 
> > > 
> > > 
> > > -Original Message-
> > > From: Ekberg Mats KONSULT 
> > [mailto:[EMAIL PROTECTED] 
> > > Sent: 29 September 2005 10:34
> > > To: 'Struts Users Mailing List'
> > > Subject: SV: prepopulating jsp page
> > > 
> > > 
> > > 
> > > > -Ursprungligt meddelande-
> > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > > Skickat: den 29 september 2005 11:26
> > > > Till: user@struts.apache.org
> > > > Ämne: prepopulating jsp page
> > > > 
> > > > Hi,
> > > >  
> > > > I am trying to pre-populate my JSP page with the values 
> > > returned from
> > > > the database when a user edits a client. I have just 
> > > recently upgraded
> > > > to Struts download 1.2.4.  
> > > >  
> > > > This is what I did before which worked: 
> > > >  
> > > > In my action class I created the form  then populated it with 
> > > > the values
> > > > from the DB.
> > > >  
> > > > CreateClientForm updateForm = new CreateClientForm();
> > > 
> > > Do this in your action:
> > > 
> > >CreateClientForm updateForm = new CreateClientForm();
> > >// populate the bean here
> > > 
> > >// then
> > >form = updateForm;
> > > 
> > > 
> > > >  
> > > >  
> > > > My struts config sent the response to the jsp page where I 
> > > > displayed the
> > > > values as follows
> > > >  
> > > >  > > >   name="createClientForm"
> > > >   type="com.medina.web.forms.CreateClientForm">
> > > >  
> > > > However in this new download the html tag library does not 
> > > have a tag
> > > > for name.  Thus I cannot add the name tag to the html:form tag.
> > > >  
> > > > So my jsp now looks ike this:
> > > >  
> > > > 
> > > >  
> > > > and my struts config.xml :
> > > >  
> > > >  > > > type="com.medina.web.action.UpdateClientAction"
> > > > name="createClientForm"
> > > > scope="session"
> > > > parameter="update"
> > > > input="/editClient.jsp">
> > > > 
> > > > 
> > > > 
> > > >  
> > > > Can anyone please advise what I need to do to get these 
> > > > values into the
> > > > jsp page as it appears empty.  How do I get around this 
> name tag?
> > > >  
> > > > Thanks
> > > >  
> 

SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT
> -Ursprungligt meddelande-
> Från: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 12:02
> Till: 'Struts Users Mailing List'
> Ämne: SV: prepopulating jsp page
> 
> Ok, so you  have a different formbean coming in to this action:
> 
> > > > >  > > > > type="com.medina.web.action.UpdateClientAction"
> > > > > name="createClientForm"
> > > > > scope="session"
> 
> The bean named createClientForm is NOT of class CreateClientForm?
> 
> If you have a bean class other than the one mapped to the 
> executing action
> that you want to populate and later display in the 
> success-form, then you
> have to:
> 
> 1 create the bean
> 2 populate it
> 3 put it in page/request/session scope
> 4 return from action
> 5 in jsp, get the bean from the scope you put it in

To clarify (maybe):

An action can only have ONE bean associated to it, the bean that brings data
from a form to the action.
If you want completely different data created in the action to be presented
in the view, you must use another class acting as a bean, put it in a scope
so that the jsp can grab it.
This bean doesnt have to be a ActionForm-bean, can be any class with
getters/setters


> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:55
> > Till: user@struts.apache.org
> > Ämne: RE: prepopulating jsp page
> > 
> > I cannot do the following 
> > 
> > CreateClientForm updateForm = (CreateClientForm)actionForm;
> > 
> > Because the action is called from a search page and has a 
> > different form coming in.  Thus when I try to reassign it I 
> > get a class cast exception.
> > 
> > I also tried the first way you mentioned, but that did not 
> > populate the form either.
> > 
> > 
> > -Original Message-
> > From: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Sent: 29 September 2005 10:46
> > To: 'Struts Users Mailing List'
> > Subject: SV: prepopulating jsp page
> > 
> > I seen to be very fast and erronous today, try this:
> > 
> > 
> > 
> > public ActionForward execute(
> >   ActionMapping actionMapping,
> >   AtionForm actionForm, 
> >   HttpServletRequest httpServletRequest,
> >   HttpServletResponse httpServletResponse) throws Exception 
> >  
> >   CreateClientForm updateForm = (CreateClientForm)actionForm;
> > 
> >   // populate the bean here
> >   updateForm.setXXX( );
> >   updateForm.setYYY( );
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: Ekberg Mats KONSULT 
> > [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:41
> > > Till: 'Struts Users Mailing List'
> > > Ämne: SV: prepopulating jsp page
> > > 
> > > 
> > > 
> > > > -Ursprungligt meddelande-
> > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > > Skickat: den 29 september 2005 11:38
> > > > Till: user@struts.apache.org
> > > > Ämne: RE: prepopulating jsp page
> > > > 
> > > > Do this in your action:
> > > > 
> > > >CreateClientForm updateForm = new CreateClientForm();
> > > >// populate the bean here
> > > > 
> > > >// then
> > > >form = updateForm;
> > > > 
> > > > When you say 
> > > > 
> > > > form = updateForm;
> > > > 
> > > > what is my variable form of type?
> > > 
> > >   Form is the variable you got in your actions execute method:
> > > 
> > > public ActionForward execute(ActionMapping actionMapping, 
> > > ActionForm
> > > actionForm, HttpServletRequest httpServletRequest, 
> > HttpServletResponse
> > > httpServletResponse) throws Exception 
> > > 
> > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -Original Message-
> > > > From: Ekberg Mats KONSULT 
> > > [mailto:[EMAIL PROTECTED] 
> > > > Sent: 29 September 2005 10:34
> > > > To: 'Struts Users Mailing List'
> > > > Subject: SV: prepopulating jsp page
> > > > 
> > > > 
> > > > 
> > > > > -Ursprungligt meddelande-
> > > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > > > Skickat: den 29 september 2005 11:26
> > > > > Till: user@struts.apache.org
> > > > > Ämne: prepopulating jsp page
> > > > > 
> > > > > Hi,
> > > > >  
> > > > > I am trying to pre-populate my JSP page with the values 
> > > > returned from
> > > > > the database when a user edits a client. I have just 
> > > > recently upgraded
> > > > > to Struts download 1.2.4.  
> > > > >  
> > > > > This is what I did before which worked: 
> > > > >  
> > > > > In my action class I created the form  then populated it with 
> > > > > the values
> > > > > from the DB.
> > > > >  
> > > > > CreateClientForm updateForm = new CreateClientForm();
> > > > 
> > > > Do this in your action:
> > > > 
> > > >CreateClientForm updateForm = new CreateClientForm();
> > > >// populate the bean here
> > > > 
> > > >// then
> > > >form = updateForm;
> > > > 
> > > > 
> > > > >  
> > > > >  
> > > > > My struts config sent the response to the jsp page where I 
> > > > > displayed th

Re: prepopulating jsp page

2005-09-29 Thread Cedric Levieux

It seems I need to reformulate my answer.

You need to CREATE a form with data for your NEXT page for populating 
the fields.

You can't retrieve the form from the actionForm parameter of the action.

So you create in the execute function a form like this :

CreateClientForm updateForm = new CreateClientForm();
updateForm.setClientName(...); // bla bla bla

and

request.getSession().setAttribute("createClientForm", updateForm);

normally, it works,

Cedric


Cedric Levieux wrote:


Hi,

Did you put the new form into session or into 
whatever-the-scope-of-the-form-must-be ?

If not, the error may come from that

Regards,

Cedric

[EMAIL PROTECTED] wrote:


Hi,

I am trying to pre-populate my JSP page with the values returned from
the database when a user edits a client. I have just recently upgraded
to Struts download 1.2.4. 
This is what I did before which worked:

In my action class I created the form  then populated it with the values
from the DB.

CreateClientForm updateForm = new CreateClientForm();


My struts config sent the response to the jsp page where I displayed the
values as follows



However in this new download the html tag library does not have a tag
for name.  Thus I cannot add the name tag to the html:form tag.

So my jsp now looks ike this:



and my struts config.xml :


   
   
   

Can anyone please advise what I need to do to get these values into the
jsp page as it appears empty.  How do I get around this name tag?

Thanks


 




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






SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT
Oups, sorry this is the way you should do it:


CreateClientForm updateForm = (CreateClientForm)form;

// populate the bean here
updateForm.setXXX = "blah blah";

And you must have the bean in session scope (as you have)
 

> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:38
> Till: user@struts.apache.org
> Ämne: RE: prepopulating jsp page
> 
> Do this in your action:
> 
>CreateClientForm updateForm = new CreateClientForm();
>// populate the bean here
> 
>// then
>form = updateForm;
> 
> When you say 
> 
> form = updateForm;
> 
> what is my variable form of type?
> 
> 
> 
> 
> -Original Message-
> From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Sent: 29 September 2005 10:34
> To: 'Struts Users Mailing List'
> Subject: SV: prepopulating jsp page
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:26
> > Till: user@struts.apache.org
> > Ämne: prepopulating jsp page
> > 
> > Hi,
> >  
> > I am trying to pre-populate my JSP page with the values 
> returned from
> > the database when a user edits a client. I have just 
> recently upgraded
> > to Struts download 1.2.4.  
> >  
> > This is what I did before which worked: 
> >  
> > In my action class I created the form  then populated it with 
> > the values
> > from the DB.
> >  
> > CreateClientForm updateForm = new CreateClientForm();
> 
> Do this in your action:
> 
>CreateClientForm updateForm = new CreateClientForm();
>// populate the bean here
> 
>// then
>form = updateForm;
> 
> 
> >  
> >  
> > My struts config sent the response to the jsp page where I 
> > displayed the
> > values as follows
> >  
> >  >   name="createClientForm"
> >   type="com.medina.web.forms.CreateClientForm">
> >  
> > However in this new download the html tag library does not 
> have a tag
> > for name.  Thus I cannot add the name tag to the html:form tag.
> >  
> > So my jsp now looks ike this:
> >  
> > 
> >  
> > and my struts config.xml :
> >  
> >  > type="com.medina.web.action.UpdateClientAction"
> > name="createClientForm"
> > scope="session"
> > parameter="update"
> > input="/editClient.jsp">
> > 
> > 
> > 
> >  
> > Can anyone please advise what I need to do to get these 
> > values into the
> > jsp page as it appears empty.  How do I get around this name tag?
> >  
> > Thanks
> >  
> > 
> 
> -
> 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: prepopulating jsp page

2005-09-29 Thread faisal.shoukat
Yes, the flow is like this:

My struts config has this action for the search page:






This sends the actionclientForm to the actionclientaction class.

This class goes to the db gets the information then forwards to editClient.jsp 
which has the action mapped:

 > > > type="com.medina.web.action.UpdateClientAction"
> > > > name="createClientForm"
> > > > scope="session"

So when I tried to re cast it it threw a class cast because I was trying to 
cast actionClientForm to createClientForm.  

The bean named createCleintForm is of class createClientForm which is mapped in 
the form beans of config.xml.

Does the same still apply?

Thanks

-Original Message-
From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 11:02
To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page

Ok, so you  have a different formbean coming in to this action:

> > > >  > > > type="com.medina.web.action.UpdateClientAction"
> > > > name="createClientForm"
> > > > scope="session"

The bean named createClientForm is NOT of class CreateClientForm?

If you have a bean class other than the one mapped to the executing action
that you want to populate and later display in the success-form, then you
have to:

1 create the bean
2 populate it
3 put it in page/request/session scope
4 return from action
5 in jsp, get the bean from the scope you put it in


> -Ursprungligt meddelande-
> Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Skickat: den 29 september 2005 11:55
> Till: user@struts.apache.org
> Ämne: RE: prepopulating jsp page
> 
> I cannot do the following 
> 
> CreateClientForm updateForm = (CreateClientForm)actionForm;
> 
> Because the action is called from a search page and has a 
> different form coming in.  Thus when I try to reassign it I 
> get a class cast exception.
> 
> I also tried the first way you mentioned, but that did not 
> populate the form either.
> 
> 
> -Original Message-
> From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Sent: 29 September 2005 10:46
> To: 'Struts Users Mailing List'
> Subject: SV: prepopulating jsp page
> 
> I seen to be very fast and erronous today, try this:
> 
> 
> 
> public ActionForward execute(
>   ActionMapping actionMapping,
>   AtionForm actionForm, 
>   HttpServletRequest httpServletRequest,
>   HttpServletResponse httpServletResponse) throws Exception 
>  
>   CreateClientForm updateForm = (CreateClientForm)actionForm;
> 
>   // populate the bean here
>   updateForm.setXXX( );
>   updateForm.setYYY( );
> 
> 
> 
> > -Ursprungligt meddelande-
> > Från: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:41
> > Till: 'Struts Users Mailing List'
> > Ämne: SV: prepopulating jsp page
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:38
> > > Till: user@struts.apache.org
> > > Ämne: RE: prepopulating jsp page
> > > 
> > > Do this in your action:
> > > 
> > >CreateClientForm updateForm = new CreateClientForm();
> > >// populate the bean here
> > > 
> > >// then
> > >form = updateForm;
> > > 
> > > When you say 
> > > 
> > > form = updateForm;
> > > 
> > > what is my variable form of type?
> > 
> >   Form is the variable you got in your actions execute method:
> > 
> > public ActionForward execute(ActionMapping actionMapping, 
> > ActionForm
> > actionForm, HttpServletRequest httpServletRequest, 
> HttpServletResponse
> > httpServletResponse) throws Exception 
> > 
> > 
> > > 
> > > 
> > > 
> > > 
> > > -Original Message-
> > > From: Ekberg Mats KONSULT 
> > [mailto:[EMAIL PROTECTED] 
> > > Sent: 29 September 2005 10:34
> > > To: 'Struts Users Mailing List'
> > > Subject: SV: prepopulating jsp page
> > > 
> > > 
> > > 
> > > > -Ursprungligt meddelande-
> > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > > Skickat: den 29 september 2005 11:26
> > > > Till: user@struts.apache.org
> > > > Ämne: prepopulating jsp page
> > > > 
> > > > Hi,
> > > >  
> > > > I am trying to pre-populate my JSP page with the values 
> > > returned from
> > > > the database when a user edits a client. I have just 
> > > recently upgraded
> > > > to Struts download 1.2.4.  
> > > >  
> > > > This is what I did before which worked: 
> > > >  
> > > > In my action class I created the form  then populated it with 
> > > > the values
> > > > from the DB.
> > > >  
> > > > CreateClientForm updateForm = new CreateClientForm();
> > > 
> > > Do this in your action:
> > > 
> > >CreateClientForm updateForm = new CreateClientForm();
> > >// populate the bean here
> > > 
> > >// then
> > >form = updateForm;
> > > 
> > > 
> > > >  
> > > >  
> > > > My struts config sent the response to the jsp page where I 
> > > > displayed the
> > > > values as follows
> > 

RequestProcessor problem?

2005-09-29 Thread Sławek Tuleja
Hi all

I have problem with RequestProcessor. I added this statement to 
struts-config.xml:



where CustomRequestProcessor is:

//--

public class CustomRequestProcessor extends RequestProcessor {

protected ActionForward processActionPerform(HttpServletRequest 
request,HttpServletResponse response, Action action, ActionForm form, 
ActionMapping mapping) 
throws IOException, ServletException {

HttpSession session = request.getSession( );
User user = (User) session.getAttribute("user");

if (user == null) {
return mapping.findForward("stronaglowna");
} else {
return super.processActionPerform(request, response, action, form, mapping);

}
}
}
//-

in my project I use TILES

Problem: I got this error:

SEVERE: Servlet /RekrutApplication threw load() exception
javax.servlet.UnavailableException: TilesPlugin : Specified RequestProcessor 
not compatible with TilesRequestProcessor
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4087)
at 
org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1175)
at 
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:368)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:168)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Ziomalu wydaj płytę na legalu! 
Wielki konkurs RAP ESKADRA czeka!
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Frapeskadra.html&sid=520



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



display checkbox with unique value using displaytag

2005-09-29 Thread R.Vijayaraghavan
Hello,

I am using displaytag to display a table of records. I am able to add a
checkbox as the first column using:





The problem is that I am not able to set a unique value for each checkbox. I
am having a column in the recordset stored in a RowSetDynaClass that has the
unique values for all the checkboxes. I just need to assign them
appropriately.

regards,
vijay.



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



SV: prepopulating jsp page

2005-09-29 Thread Ekberg Mats KONSULT
Your original question was on how to survive without the name-attribute in
the  tag.

The answer is that the later versions of taglib/struts dont allow you to use
the same Action-class on different ActionForms by changing the
name-attribute (since it has been removed).
You are now forced to have a mapping for every combination of
ActionForm/Action.

Since I dont know how your ActionForm-classes looks like I cant give you
exact help.
But wouldnt it be possible to share a ActionForm-class for the
edit/delete/search/create Actions?

> Yes, the flow is like this:
> 
> My struts config has this action for the search page:
> 
>  type="com.medina.web.action.ActionClientAction"
> name="actionClientForm"
> scope="session"
> input="/searchClient.jsp">
> 
> 
> 
> 
> This sends the actionclientForm to the actionclientaction class.
> 
> This class goes to the db gets the information then forwards 
> to editClient.jsp which has the action mapped:
> 
>  > > > > type="com.medina.web.action.UpdateClientAction"
> > > > > name="createClientForm"
> > > > > scope="session"
> 
> So when I tried to re cast it it threw a class cast because I 
> was trying to cast actionClientForm to createClientForm.  
> 
> The bean named createCleintForm is of class createClientForm 
> which is mapped in the form beans of config.xml.
> 
> Does the same still apply?
> 
> Thanks
> 
> -Original Message-
> From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
> Sent: 29 September 2005 11:02
> To: 'Struts Users Mailing List'
> Subject: SV: prepopulating jsp page
> 
> Ok, so you  have a different formbean coming in to this action:
> 
> > > > >  > > > > type="com.medina.web.action.UpdateClientAction"
> > > > > name="createClientForm"
> > > > > scope="session"
> 
> The bean named createClientForm is NOT of class CreateClientForm?
> 
> If you have a bean class other than the one mapped to the 
> executing action
> that you want to populate and later display in the 
> success-form, then you
> have to:
> 
> 1 create the bean
> 2 populate it
> 3 put it in page/request/session scope
> 4 return from action
> 5 in jsp, get the bean from the scope you put it in
> 
> 
> > -Ursprungligt meddelande-
> > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Skickat: den 29 september 2005 11:55
> > Till: user@struts.apache.org
> > Ämne: RE: prepopulating jsp page
> > 
> > I cannot do the following 
> > 
> > CreateClientForm updateForm = (CreateClientForm)actionForm;
> > 
> > Because the action is called from a search page and has a 
> > different form coming in.  Thus when I try to reassign it I 
> > get a class cast exception.
> > 
> > I also tried the first way you mentioned, but that did not 
> > populate the form either.
> > 
> > 
> > -Original Message-
> > From: Ekberg Mats KONSULT 
> [mailto:[EMAIL PROTECTED] 
> > Sent: 29 September 2005 10:46
> > To: 'Struts Users Mailing List'
> > Subject: SV: prepopulating jsp page
> > 
> > I seen to be very fast and erronous today, try this:
> > 
> > 
> > 
> > public ActionForward execute(
> >   ActionMapping actionMapping,
> >   AtionForm actionForm, 
> >   HttpServletRequest httpServletRequest,
> >   HttpServletResponse httpServletResponse) throws Exception 
> >  
> >   CreateClientForm updateForm = (CreateClientForm)actionForm;
> > 
> >   // populate the bean here
> >   updateForm.setXXX( );
> >   updateForm.setYYY( );
> > 
> > 
> > 
> > > -Ursprungligt meddelande-
> > > Från: Ekberg Mats KONSULT 
> > [mailto:[EMAIL PROTECTED] 
> > > Skickat: den 29 september 2005 11:41
> > > Till: 'Struts Users Mailing List'
> > > Ämne: SV: prepopulating jsp page
> > > 
> > > 
> > > 
> > > > -Ursprungligt meddelande-
> > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > > > Skickat: den 29 september 2005 11:38
> > > > Till: user@struts.apache.org
> > > > Ämne: RE: prepopulating jsp page
> > > > 
> > > > Do this in your action:
> > > > 
> > > >CreateClientForm updateForm = new CreateClientForm();
> > > >// populate the bean here
> > > > 
> > > >// then
> > > >form = updateForm;
> > > > 
> > > > When you say 
> > > > 
> > > > form = updateForm;
> > > > 
> > > > what is my variable form of type?
> > > 
> > >   Form is the variable you got in your actions execute method:
> > > 
> > > public ActionForward execute(ActionMapping actionMapping, 
> > > ActionForm
> > > actionForm, HttpServletRequest httpServletRequest, 
> > HttpServletResponse
> > > httpServletResponse) throws Exception 
> > > 
> > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -Original Message-
> > > > From: Ekberg Mats KONSULT 
> > > [mailto:[EMAIL PROTECTED] 
> > > > Sent: 29 September 2005 10:34
> > > > To: 'Struts Users Mailing List'
> > > > Subject: SV: prepopulating jsp page
> > > > 
> > > > 
> > > > 
> > > > > -Ursprungligt meddelande-
> > > > > Från: [EMA

Re: Debugging

2005-09-29 Thread Borislav Sabev

Laurie Harper wrote:


Bryon Lape wrote:


hm strange ... in this case I don't know what ot tell you ...
the file name should be struts.log
may be somebody who is more familiar with log4j should give you an idea
...
borislav



Let me do a search on the whole harddrive for that file name.



make sure your log4j.properties is in WEB-INF/classes; I think 
Borislav said to put it in the root directory of your webapp which 
wont work


L.

Yes, Lary is right, I meant to put it the root directory where the is 
the project developed, not deployed. So at deployment stage, the file 
will be copied to WEB-INF/classes.
By the way,  how can I control WHERE the log files are created? Is it 
possible to be done without writing code (i.e only to change some 
setting in log4j.properties file)?


Borislav

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



Re: RequestProcessor problem?

2005-09-29 Thread gramani
Sławek Tuleja <[EMAIL PROTECTED]> wrote on 09/29/2005 06:22:45 AM:

> Problem: I got this error:
> 
> SEVERE: Servlet /RekrutApplication threw load() exception
> javax.servlet.UnavailableException: TilesPlugin : Specified 
> RequestProcessor not compatible with TilesRequestProcessor

Here's the solution: Extend tilesRequestProcessor instead. Googling will 
give you a discussion:

http://jroller.com/page/JamesGoodwill?anchor=using_tiles_and_a_custom

Regards,
Geeta


Form Bean Question

2005-09-29 Thread Troy Bull

Hello:

I have a question about how to setup a "situation" I have.  I want to 
have a jsp page that has a variable number of text fields on it,  named 
qty1, qty2, ... qtyN where N is some unknown number.   I tried to set it 
up and use no form bean at all so I could just pull them from the 
request object in my action.  So my question is, can I use struts 
without a form bean? And if I can't what do I have to do so I can handle 
situations like this?


Thanks
troy

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



Re: Form Bean Question

2005-09-29 Thread Murray Collingwood
You could write lots of jsp code to handle it:


 


 



 


As you can imagine this is pretty silly.

In your action form, when preparing the display (ie when you put the text 
fields into the 
request scope) instead of adding them as separate entries it would be better to 
create a 
collection (eg ArrayList is good), add each string value to this collection, 
and then add 
this single collection to the request scope.  Then when you get to your JSP you 
can use:


  


This is better.  You may need to play around to retrieve the strings you need 
in the form 
you need them.   Personally I would create objects and add these to the 
collection.  The 
objects are extracted and processed  one at a time through the iterate loop.  
The you 
can use the name/property combo to retrieve any value from these objects.

Kind regards
mc


On 29 Sep 2005 at 8:00, Troy Bull wrote:

> Hello:
> 
> I have a question about how to setup a "situation" I have.  I want to 
> have a jsp page that has a variable number of text fields on it,  named 
> qty1, qty2, ... qtyN where N is some unknown number.   I tried to set it 
> up and use no form bean at all so I could just pull them from the 
> request object in my action.  So my question is, can I use struts 
> without a form bean? And if I can't what do I have to do so I can handle 
> situations like this?
> 
> Thanks
> troy
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005


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



AW: display checkbox with unique value using displaytag

2005-09-29 Thread R. Markham
Hi Vijay,

I am wondering why do you want unique value in a check box. A checkbox has
the values true or false.

Regards

Richard


-Ursprüngliche Nachricht-
Von: R.Vijayaraghavan [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 29. September 2005 12:05
An: Struts Users Mailing List
Betreff: display checkbox with unique value using displaytag

Hello,

I am using displaytag to display a table of records. I am able to add a
checkbox as the first column using:





The problem is that I am not able to set a unique value for each checkbox. I
am having a column in the recordset stored in a RowSetDynaClass that has the
unique values for all the checkboxes. I just need to assign them
appropriately.

regards,
vijay.



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



another ActionForm-to-POJO binding tool: xsnapshot 1.1 beta released

2005-09-29 Thread Bill Schneider

XSnapshot 1.1 beta was just released to SourceForge.

http://xsnapshot.sourceforge.net/

This is an XDoclet module that helps you generate ActionForms from POJOs 
with functionality for data binding/conversion between the two.  You can 
use it for a lot of other things besides ActionForms too, like 
generating DTOs for remoting (Hessian, SOAP, AJAX/DWR, etc.) and I 
suppose you could use it with JSF too but it hasn't been tried.


The advantage XSnapshot has over simpler solutions like 
BeanUtils.copyProperties or the existing @struts.form tags is its more 
robust conversion model.  This can handle cases like POJOs with a 
many-to-one relationship controlled by an  in the HTML 
form.  The HTTP POST only sends back an ID, represented by a Long in the 
ActionForm, and somehow that has to be reconstituted into an actual POJO 
to update the persistent relationship (with Hibernate, anyhow).


An example of how you would mark up an object to generate a form:

/**
 * @hibernate.class table="employee"
 * @xsnapshot.snapshot-class name="form"
class="net.sf.xsnapshot.example.presentation.web.struts.forms.EmployeeForm"
 *   extends="org.apache.struts.validator.ValidatorActionForm"
 */
public class Employee {

/**
 * @hibernate.many-to-one column="location_id"
 * @xsnapshot.property match="form" name="locationId"
type="java.lang.Long" nested-property="id" copy-to-model="true"
 */
  public Location getLocation()
}

This will result in an EmployeeForm with methods "Long getLocationId()" 
and "setLocationId(Long)".  (Simple string/int properties are much 
simpler.)


Then in your Actions, you call XSnapshotUtils:
employeeForm =
  (EmployeeForm)m_xsnapshotUtils.createSnapshot(employee, "form");
or
   m_xsnapshotUtils.copyIntoModel(employeeForm, employee);

this presumes that a xsnapshotUtils instance is configured, normally via 
Spring.  There is an example app in the source distribution that shows 
you how to do this.


The documentation is somewhat lacking, as there are only two regular 
contributors to the project and we both have very limited time to devote 
to it (darned customers!)  But the example app in the source 
distribution would show you how to set it up.


-- Bill
--
Bill Schneider
Chief Architect

Vecna Technologies
5004 Lehigh Rd.
College Park, MD 20740
[EMAIL PROTECTED]
t: 301-864-7253 x1140
f: 301-699-3180


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



Re: Form Bean Question

2005-09-29 Thread Frank W. Zammetti
Yes, you absolutely can use Struts with ActionForms.  You will have to
take responsibility for getting values out of request, and for
validatation, etc., but the answer is yes.

However, before you do that, have a look at this page:

http://struts.apache.org/faqs/indexedprops.html

If you want to still use ActionForms, this will probably help you do so.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 29, 2005 9:00 am, Troy Bull said:
> Hello:
>
> I have a question about how to setup a "situation" I have.  I want to
> have a jsp page that has a variable number of text fields on it,  named
> qty1, qty2, ... qtyN where N is some unknown number.   I tried to set it
> up and use no form bean at all so I could just pull them from the
> request object in my action.  So my question is, can I use struts
> without a form bean? And if I can't what do I have to do so I can handle
> situations like this?
>
> Thanks
> troy
>
> -
> 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: ValidWhen and string comparison

2005-09-29 Thread Bryon Lape
> Niall Pemberton a écrit :
>
>>What you have should work - but its always going to give an error unless
>>statut is set to "Doctorant".
>>
>>
> Yes! It's what i want.
>
>>Are you sure "statut" is in your bean and getting populated?
>>
>>
> Yes, because when the error happen (every time with any "statut" value)
> i display errors () and the same form with the values the
> user entered. And the value of statut is what the user gave. Acording to
> me, that means that the form bean (and "statut") is populated with the
> user values.
> If i suppress the validwhen rule, the action is able to get the "statut"
> value.
>

Is there a way to display the errors without the html or bean tags?


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



iPlanet 6 and Struts 1.2

2005-09-29 Thread Bryon Lape
I am beginning to believe that iPlanet is the root of my problems.  I was
successful in getting iPlanet to use the 1.4 version of the JVM, but it
still does not resolves the MessageResources properly.  In the debug log,
I do see what looks like it is reading the files, but I do not see a
"found this tag with this value" message, so I am not sure.  I18N
complained about not being able to find tiles-defs_en.xml and
tiles-defs_en_US.xml.  So I created these files too.  Even without these
files being in the struts config, it didn't complain about them.  When a
tag (such as  tries to use a key, I get a null pointer
error.

iPlanet WS 6.0 is a 2.2 servlet container.  Would this effect struts?

THanks for you help.


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



RE: writing images from a database

2005-09-29 Thread Braun, James F
I didn't mean for this to become debate. I was stuck with a legacy app
that required storing images in the db.

With the help of this list and some digging I think I came up with a
relatively elegant solution (subject to expert critique which is
welcome). I don't know if attachments are allowed on this list so I've
included the how-to I write up for myself after every quest of this
sort. Any suggestions on how to improve this would be appreciated.

Although I'm new to struts I've collected several of these how-to
articles which address problems I've seen on this list. Is there an
archive I can post them where they can be critiqued and shared with
others?

Thanks for all the help.

J.

J. Braun
Polaroid Corp.
Waltham MA USA
+1 (781) 386 6871
[EMAIL PROTECTED]

"Lemmings, as a group, have a very bad reputation. But no individual
lemming has ever been singled out for blame."
Anonymous

/// code /

How to read an image from a db and display in an html page

Goal: Display an image in a .jsp page that is stored in a database blob

Synopsis: The blob is read into a byte array that is stored in the
ActionForm. The .jsp page uses a http://struts.apache.org/userGuide/struts-html.html#img

The code:

-- This reads the image in from the db
try
{
  pictureStream = rs.getBinaryStream("picture");
  byte[] bytes = new byte[1024*1024]; // some maximum size

  int byteSize = pictureStream.read(bytes); // read in the bytes
  
  byte[] bytesX = new byte[byteSize]; // create a new array of
the proper size
  
  for(int i=0;i
  


  

  


-- This is the action code that writes the array to the response

public class JpegServerAction
  extends Action
{
  public ActionForward execute(ActionMapping actionMapping, 
 ActionForm actionForm,
   HttpServletRequest request,
   HttpServletResponse response)
  {
WL_Logger logger = new WL_Logger();

SelectionForm selectionForm = (SelectionForm)actionForm;

try
{
  response.setContentType("image/jpeg");
  ServletOutputStream out = response.getOutputStream();
  if(selectionForm.getPictureBytes() != null)
  {
out.write(selectionForm.getPictureBytes());
  }
}
catch(IOException ex)
{
  System.err.println("JpegServerAction.execute: " +
ex.getMessage());
  logger.error("JpegServerAction.execute: " + ex.getMessage());
}

return null; // tells the Action servlet to not do anything more
  }
}

-- This is the struts-config.xml entry - scope must be session!



-- 
This transmission is intended only for use by the addressee(s) named herein and 
may contain information that is proprietary, confidential and/or legally 
privileged. If you are not the intended recipient, you are hereby notified that 
any disclosure, copying, distribution, or use of the information contained 
herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received 
this transmission in error, please immediately contact the sender and destroy 
the material in its entirety, whether in electronic or hard copy format. Thank 
you.



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



Re: writing images from a database

2005-09-29 Thread Niall Pemberton
You can post them on the Struts wiki:

   http://wiki.apache.org/struts/

Niall

- Original Message - 
From: "Braun, James F" <[EMAIL PROTECTED]>
Sent: Thursday, September 29, 2005 3:15 PM


Although I'm new to struts I've collected several of these how-to
articles which address problems I've seen on this list. Is there an
archive I can post them where they can be critiqued and shared with
others?



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



RE: writing images from a database

2005-09-29 Thread Frank W. Zammetti
The only question I would ask is why your storing it in the ActionForm? 
If it's request-scoped, that means you are reading the image from the
database with each request (or from server cache I suppose), which is
something I would suggest avoiding if possible.  If the form is
session-scoped (which I see below that it is), I would be weary of storing
something as large as an image in it, most especially if you are working
in a clustered environment.  Even in a single-server environment though,
it is always best to keep session size as small as possible, and a few K
for an image is something I would personally think long and hard about.

Do you have a reason for storing it in the ActionForm?  Maybe you have a
requirement that causes that to make more sense?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 29, 2005 10:15 am, Braun, James F said:
> I didn't mean for this to become debate. I was stuck with a legacy app
> that required storing images in the db.
>
> With the help of this list and some digging I think I came up with a
> relatively elegant solution (subject to expert critique which is
> welcome). I don't know if attachments are allowed on this list so I've
> included the how-to I write up for myself after every quest of this
> sort. Any suggestions on how to improve this would be appreciated.
>
> Although I'm new to struts I've collected several of these how-to
> articles which address problems I've seen on this list. Is there an
> archive I can post them where they can be critiqued and shared with
> others?
>
> Thanks for all the help.
>
> J.
>
> J. Braun
> Polaroid Corp.
> Waltham MA USA
> +1 (781) 386 6871
> [EMAIL PROTECTED]
>
> "Lemmings, as a group, have a very bad reputation. But no individual
> lemming has ever been singled out for blame."
> Anonymous
>
> /// code /
>
> How to read an image from a db and display in an html page
>
> Goal: Display an image in a .jsp page that is stored in a database blob
>
> Synopsis: The blob is read into a byte array that is stored in the
> ActionForm. The .jsp page uses a  the byte array to the response.
>
> Reference: http://struts.apache.org/userGuide/struts-html.html#img
>
> The code:
>
> -- This reads the image in from the db
> try
> {
>   pictureStream = rs.getBinaryStream("picture");
>   byte[] bytes = new byte[1024*1024]; // some maximum size
>
>   int byteSize = pictureStream.read(bytes); // read in the bytes
>
>   byte[] bytesX = new byte[byteSize]; // create a new array of
> the proper size
>
>   for(int i=0;i   {
> bytesX[i] = bytes[i];
>   }
>
>   pictureBytes = bytesX; // assign it to the form variable
> }
> catch(FileNotFoundException ex)
> {
>   System.err.println("selectionForm.populate.picturefile: " +
> ex.getMessage());
>   logger.error("selectionForm.populate.picturefile: " +
> ex.getMessage());
> }
> catch(IOException ex)
> {
>   System.err.println("selectionForm.populate.picturefile: " +
> ex.getMessage());
>   logger.error("selectionForm.populate.picturefile: " +
> ex.getMessage());
> }
>
> -- This is the .jsp code
> 
>align="center">
> 
> 
>width="105" height="142"
> alt="Client photo" />
> 
>   
> 
>
> -- This is the action code that writes the array to the response
>
> public class JpegServerAction
>   extends Action
> {
>   public ActionForward execute(ActionMapping actionMapping,
>ActionForm actionForm,
>HttpServletRequest request,
>HttpServletResponse response)
>   {
> WL_Logger logger = new WL_Logger();
>
> SelectionForm selectionForm = (SelectionForm)actionForm;
>
> try
> {
>   response.setContentType("image/jpeg");
>   ServletOutputStream out = response.getOutputStream();
>   if(selectionForm.getPictureBytes() != null)
>   {
> out.write(selectionForm.getPictureBytes());
>   }
> }
> catch(IOException ex)
> {
>   System.err.println("JpegServerAction.execute: " +
> ex.getMessage());
>   logger.error("JpegServerAction.execute: " + ex.getMessage());
> }
>
> return null; // tells the Action servlet to not do anything more
>   }
> }
>
> -- This is the struts-config.xml entry - scope must be session!
>
>  path="/jpegServerAction"
> scope="session"
> type="transcard15.JpegServerAction"
> validate="false" />
>
> --
> This transmission is intended only for use by the addressee(s) named
> herein and may contain i

Re: common-digester.jar conflict when usings Struts with Jasper Reports

2005-09-29 Thread Niall Pemberton
I have no problem using Commons Digester 1.7 with the latest version of
Struts (1.2.7).

Looks to me like there is another reason why its not working - check you're
logs.

Niall

- Original Message - 
From: "Kashif Inam" <[EMAIL PROTECTED]>
Sent: Thursday, September 29, 2005 7:46 AM


> I am working on a web application with Struts and Jasper Reports.
> Jasper Reports requires common-digester.1.7.jar ( that is a latest version
of
> struts's common-digester.jar), when i use this file, i get the following
> exceptions
>
> javax.servlet.jsp.JspException: Cannot find ActionMappings or
ActionFormBeans
> collection at org.apache.struts.taglib.html.FormTag.lookup
> (FormTag.java:798) at org.apache.struts.taglib.html.FormTag.doStartTag
> (FormTag.java:506) at _index._jspService(_index.java:53)
>
>
> If i use common-digester.jar (struts version, older one)..then my Jasper
> Reports throws following exception..
>
>
> java.lang.NoClassDefFoundError:
> org/apache/commons/digester/SetNestedPropertiesRule at
> net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:200) at
> net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:165) at
> net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:149) at
> com.netsol.pms.reports.ReportManager.buildReport(ReportManager.java:210)
> at com.netsol.pms.reports.ReportManager.getPreview
> (ReportManager.java:184)
>
> Please suggest me how can i resolve this conflict..



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



Re: display checkbox with unique value using displaytag

2005-09-29 Thread Michael Jouravlev
German sense of humor, he-he. Vijay, have you already read DisplayTag
manual? It is a well-written document, you will need no more than 30
minutes to start with decorators.

Michael.

On 9/29/05, R. Markham <[EMAIL PROTECTED]> wrote:
> Hi Vijay,
>
> I am wondering why do you want unique value in a check box. A checkbox has
> the values true or false.
>
> Regards
>
> Richard
>
> -Ursprüngliche Nachricht-
> Von: R.Vijayaraghavan [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 29. September 2005 12:05
> An: Struts Users Mailing List
> Betreff: display checkbox with unique value using displaytag
>
> Hello,
>
> I am using displaytag to display a table of records. I am able to add a
> checkbox as the first column using:
>
> 
> 
> 
>
> The problem is that I am not able to set a unique value for each checkbox. I
> am having a column in the recordset stored in a RowSetDynaClass that has the
> unique values for all the checkboxes. I just need to assign them
> appropriately.
>
> regards,
> vijay.
>
>
>
> -
> 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]



[OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Braun, James F wrote:


I didn't mean for this to become debate.


Yeah, good luck with that.

*lol*

As you've discovered, some people are more interested in being uppity 
than actually helping with the core question :/



 byte[] bytes = new byte[1024*1024]; // some maximum size
 int byteSize = pictureStream.read(bytes); // read in the bytes
 byte[] bytesX = new byte[byteSize]; // create a new array of
the proper size
 for(int i=0;i 


People like me ;)

Oh god remove the comments. Bottom line: if someone can't figure out 
what's going on here w/o relying on the comments then they're fired.


Java is already like crack for people that like to type; why make it 
worse with redundant commentary?


Just a pet peeve of mine ;)

Dave



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



Re: writing images from a database

2005-09-29 Thread Michael Jouravlev
On 9/29/05, Braun, James F <[EMAIL PROTECTED]> wrote:
> With the help of this list and some digging I think I came up with a
> relatively elegant solution (subject to expert critique which is
> welcome). I don't know if attachments are allowed on this list so I've
> included the how-to I write up for myself after every quest of this
> sort. Any suggestions on how to improve this would be appreciated.



Whoa, a whole action class and a form bean for one measly picture. Too
much even for me. I would prefer something more simpler and generic,
like a servlet with image name as parameter.

Michael.

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Frank W. Zammetti
On Thu, September 29, 2005 11:57 am, Dave Newton said:
> Oh god remove the comments. Bottom line: if someone can't figure out
> what's going on here w/o relying on the comments then they're fired.

Well now, *this* is a good way to go off-topic in a hurry Dave! :)

I personally feel just the opposite... the more comments the better, and I
don't generally care how "pointless" they are... well, ok, if I see:

a++; // Add 1 to A

... I tend to groan rather loudly, but that's a bit extreme :)  When your
talking about all the myriad classes available in Java, it's virtually
impossible to remember them all, what their methods do, etc.

For instance, take this line:

String s = s1.toUpperCase().trim().replace('A', '-');

Now, that's pretty straight-forward.  But, if someone added a comment:

// Convert s1 to all upper-case, trim whitespace from both ends and
replace all A's with -'s and store result in s

I wouldn't frown upon that for two reasons... one, me looking at it
doesn't have to remember what replace() does (i.e., does it replace ALL
occurances of 'A' or just the first?) and two, it indicates that the
developer who wrote it knew what he intended to do and wrote the code
accordingly.

So for me, the more comments the better, even if they are commenting on
what is an obvious thing for most.

Frank

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



Re: More Tiles and Definitions problems

2005-09-29 Thread Graham Reeds

Guillermo Castro wrote:

Contrary to popular belief, tiles attributes are not propagated to
jsp's defined as attributes. It means that _header.jsp doesn't have
any information about a tile attribute 'title', thus ignoring the
 tag (when you remove the ignore="true", struts is
actually throwing an exception, that's why you get a blank page).


I guessed that something was wrong but usually when an error occurs you 
get slightly more than a blank page.  Running it through on debug just 
jumps when it gets to the  tag.


Is there any plans to extend tiles so the attributes are propagated to 
jsp's defined as attributes for 1.3x?


Also anything else to watch out for in a similar vein?


In order to do what you want you have to define your tiles as:
...snip...

Hope this helps.



That it does - thanks!

Graham Reeds.


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



Re: AW: display checkbox with unique value using displaytag

2005-09-29 Thread vijay


--- "R. Markham" <[EMAIL PROTECTED]> wrote:

> Hi Vijay,
> 
> I am wondering why do you want unique value in a
> check box. A checkbox has
> the values true or false.

I actually want to see which all checkboxes have been
checked. The values are actually primary key values
which can uniquely identify all the items shown and
therefore the items selected.

Can it be done any other way. I want to create a
shopping cart kind of stuff where the items selected
are then add to the shopping cart. Is there any
written text to read which can guide me in doing this.

regards,
vijay.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Michael Jouravlev
On 9/29/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> For instance, take this line:
>
> String s = s1.toUpperCase().trim().replace('A', '-');
>
> Now, that's pretty straight-forward.  But, if someone added a comment:
>
> // Convert s1 to all upper-case, trim whitespace from both ends and
> replace all A's with -'s and store result in s
>
> I wouldn't frown upon that for two reasons... one, me looking at it
> doesn't have to remember what replace() does (i.e., does it replace ALL
> occurances of 'A' or just the first?) and two, it indicates that the
> developer who wrote it knew what he intended to do and wrote the code
> accordingly.

Way too much for me. The only case I would appreciate comment in the
situation above, is when replace() were something like replaceAll() or
matches(). The comment would explain what regex is supposed to
describe.

Michael.

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Frank W. Zammetti wrote:


Well now, *this* is a good way to go off-topic in a hurry Dave! :)
 

I'm sorry, I have a cold. (Marginally obscure Monty Python reference. 
Every OT post needs one.)


I didn't mean to start a debate here?


I personally feel just the opposite... the more comments the better, and I
don't generally care how "pointless" they are... well, ok, if I see:

a++; // Add 1 to A
 


byte[] bytes = new byte[1024*1024]; // some maximum size
int byteSize = pictureStream.read(bytes); // read in the bytes  
*oh, so _that's_ what 'read' does*
byte[] bytesX = new byte[byteSize]; // create a new array of  
*oh, so _that's_ what 'new' does*

the proper size
for(int i=0;i*oh, so _that's_ what '=' inside a loop does*

  bytesX[i] = bytes[i];
}
pictureBytes = bytesX; // assign it to the form variable *wait, 
I already know what '=' does, but this isn't in a loop*

  }

But all those *are* "add 1 to A" comments.

Besides the fact that the copy chunk should be refactored, you could 
comment the entire block of code by saying "copy input stream to form 
variable."


And I generally would use either an accessor or some sort of "this is an 
instance variable" marker (like _pictureBytes or whatever) to remove one 
more needless comment.


I like comments (love 'em!) but commenting every line in a 5-line chunk 
of code is... silly. This example is obfuscating rather than clarifying.



String s = s1.toUpperCase().trim().replace('A', '-');

Now, that's pretty straight-forward.  But, if someone added a comment:

// Convert s1 to all upper-case, trim whitespace from both ends and
replace all A's with -'s and store result in s
 

There's some sort of limit function here. As comment character count 
approaches code character count something horrible happens. My head 
explodes, and maintaining the comments becomes more cumbersome than 
maintaining the code.


This is coming from someone that comments rather heavily, but sensibly.

Dave



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



Re: writing images from a database

2005-09-29 Thread Dave Newton

Michael Jouravlev wrote:


simpler and generic, like a servlet with image name as parameter.
 


+1

Dave



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



Re: More Tiles and Definitions problems

2005-09-29 Thread Greg Reddin

On Sep 29, 2005, at 11:22 AM, Graham Reeds wrote:

Is there any plans to extend tiles so the attributes are propagated  
to jsp's defined as attributes for 1.3x?


I thought about that last night as I was working up an example for  
your question.  It would be cool if you could pass a Tiles definition  
around as an object so included pages can have access to the  
attributes.  The example I sent last night shows how to do that now,  
but it's not very artfully done.  I'd like to be thinking about how  
to do what you're talking about.


Right now there are 2 big pushes for Tiles that might hold this up:
1.  Decouple Tiles from Struts
2.  Decouple Tiles from Servlet API.

I also have a 3rd itch which is to further refine and clean up the  
Tiles internal API.  Once those priorities are complete I think we  
can focus on enhancements like you mention, unless we can figure out  
how to squeeze it into one of those items.


Greg


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



BEA Weblogic vs. Eclipse

2005-09-29 Thread Steve Beaver
Does anyone have a preference between BEA Weblogic Workshop and
Eclipse 3.1 using TomCat

Thanks



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



AW: AW: display checkbox with unique value using displaytag

2005-09-29 Thread R. Markham
I think you have to use a javascript function which is called when one of
the checkboxes is clicked. There is an example in the display tag
documentation how to produce row number. Look at the documentation about
implicit objects. 

Regards

Richard

-Ursprüngliche Nachricht-
Von: vijay [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 29. September 2005 18:29
An: Struts Users Mailing List
Betreff: Re: AW: display checkbox with unique value using displaytag



--- "R. Markham" <[EMAIL PROTECTED]> wrote:

> Hi Vijay,
> 
> I am wondering why do you want unique value in a
> check box. A checkbox has
> the values true or false.

I actually want to see which all checkboxes have been
checked. The values are actually primary key values
which can uniquely identify all the items shown and
therefore the items selected.

Can it be done any other way. I want to create a
shopping cart kind of stuff where the items selected
are then add to the shopping cart. Is there any
written text to read which can guide me in doing this.

regards,
vijay.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.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]



RE: writing images from a database

2005-09-29 Thread Norris Shelton
We had a similar requirement.  We solved it in the same way.  We
had the special image requests served by a servlet directly. 
The servlet read the information from the database (also Oracle)
and streamed out the bytes to the user.

The DBA did tweak the database to perform moderately well
(Oracle 9, 10G is supposed to be better with BLOBs).

Also, we were storing user sourced images that came in any size
(usually 80kb).  We used the JAI libraries to scale down the
images to a fixed size (about 7kb).

--- "Braun, James F" <[EMAIL PROTECTED]> wrote:

> I didn't mean for this to become debate. I was stuck with a
> legacy app
> that required storing images in the db.
> 
> With the help of this list and some digging I think I came up
> with a
> relatively elegant solution (subject to expert critique which
> is
> welcome). I don't know if attachments are allowed on this list
> so I've
> included the how-to I write up for myself after every quest of
> this
> sort. Any suggestions on how to improve this would be
> appreciated.
> 
> Although I'm new to struts I've collected several of these
> how-to
> articles which address problems I've seen on this list. Is
> there an
> archive I can post them where they can be critiqued and shared
> with
> others?
> 
> Thanks for all the help.
> 
> J.
> 
> J. Braun
> Polaroid Corp.
> Waltham MA USA
> +1 (781) 386 6871
> [EMAIL PROTECTED]
> 
> "Lemmings, as a group, have a very bad reputation. But no
> individual
> lemming has ever been singled out for blame."
> Anonymous
> 
> /// code /
> 
> How to read an image from a db and display in an html page
> 
> Goal: Display an image in a .jsp page that is stored in a
> database blob
> 
> Synopsis: The blob is read into a byte array that is stored in
> the
> ActionForm. The .jsp page uses a  that writes
> the byte array to the response.
> 
> Reference:
> http://struts.apache.org/userGuide/struts-html.html#img
> 
> The code:
> 
> -- This reads the image in from the db
> try
> {
>   pictureStream = rs.getBinaryStream("picture");
>   byte[] bytes = new byte[1024*1024]; // some maximum
> size
> 
>   int byteSize = pictureStream.read(bytes); // read in
> the bytes
>   
>   byte[] bytesX = new byte[byteSize]; // create a new
> array of
> the proper size
>   
>   for(int i=0;i new array
>   {
> bytesX[i] = bytes[i];
>   }
>   
>   pictureBytes = bytesX; // assign it to the form
> variable
> }
> catch(FileNotFoundException ex)
> {
>  
> System.err.println("selectionForm.populate.picturefile: " +
> ex.getMessage());
>   logger.error("selectionForm.populate.picturefile: "
> +
> ex.getMessage());
> }
> catch(IOException ex)
> {
>  
> System.err.println("selectionForm.populate.picturefile: " +
> ex.getMessage());
>   logger.error("selectionForm.populate.picturefile: "
> +
> ex.getMessage());
> }
> 
> -- This is the .jsp code
> 
>valign="top"
> align="center">
> 
> 
>action="/jpegServerAction.do"
> width="105" height="142"
> alt="Client photo" />
> 
>   
> 
> 
> -- This is the action code that writes the array to the
> response
> 
> public class JpegServerAction
>   extends Action
> {
>   public ActionForward execute(ActionMapping actionMapping, 
>ActionForm actionForm,
>HttpServletRequest request,
>HttpServletResponse response)
>   {
> WL_Logger logger = new WL_Logger();
> 
> SelectionForm selectionForm = (SelectionForm)actionForm;
> 
> try
> {
>   response.setContentType("image/jpeg");
>   ServletOutputStream out = response.getOutputStream();
>   if(selectionForm.getPictureBytes() != null)
>   {
> out.write(selectionForm.getPictureBytes());
>   }
> }
> catch(IOException ex)
> {
>   System.err.println("JpegServerAction.execute: " +
> ex.getMessage());
>   logger.error("JpegServerAction.execute: " +
> ex.getMessage());
> }
> 
> return null; // tells the Action servlet to not do
> anything more
>   }
> }
> 
> -- This is the struts-config.xml entry - scope must be
> session!
> 
>  path="/jpegServerAction" 
> scope="session" 
> type="transcard15.JpegServerAction" 
> validate="false" />
> 
> -- 
> This transmission is intended only for use by the addressee(s)
> named herein and may contain information that is proprietary,
> confidential and/or legally privileged. If you are not the
> intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or u

Re: prepopulating jsp page

2005-09-29 Thread Laurie Harper
You need your ActionClientAction action to create a new CreateClientForm 
instance for the next page to work with. It can be quite seperate from 
the ActionClientForm instance that's already passed in.


In other words, don't try to cast the form that's passed into the 
ActionClient action to CreateClientForm; as you've observed, that 
doesn't work since they are different types. Instead, just create the 
new form instance and store it into the request (or session) ready for 
the next page to read:


  CreateClientForm newForm = new CreateClientForm();
  // populate newForm
  request.setAttribute("createClientForm", newForm);

L.

[EMAIL PROTECTED] wrote:

Yes, the flow is like this:

My struts config has this action for the search page:






This sends the actionclientForm to the actionclientaction class.

This class goes to the db gets the information then forwards to editClient.jsp 
which has the action mapped:


   type="com.medina.web.action.UpdateClientAction"
   name="createClientForm"
   scope="session"



So when I tried to re cast it it threw a class cast because I was trying to cast actionClientForm to createClientForm.  


The bean named createCleintForm is of class createClientForm which is mapped in 
the form beans of config.xml.

Does the same still apply?

Thanks

-Original Message-
From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 11:02

To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page

Ok, so you  have a different formbean coming in to this action:






The bean named createClientForm is NOT of class CreateClientForm?

If you have a bean class other than the one mapped to the executing action
that you want to populate and later display in the success-form, then you
have to:

1 create the bean
2 populate it
3 put it in page/request/session scope
4 return from action
5 in jsp, get the bean from the scope you put it in




-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Skickat: den 29 september 2005 11:55

Till: user@struts.apache.org
Ämne: RE: prepopulating jsp page

I cannot do the following 


CreateClientForm updateForm = (CreateClientForm)actionForm;

Because the action is called from a search page and has a 
different form coming in.  Thus when I try to reassign it I 
get a class cast exception.


I also tried the first way you mentioned, but that did not 
populate the form either.



-Original Message-
From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 10:46

To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page

I seen to be very fast and erronous today, try this:



public ActionForward execute(
 ActionMapping actionMapping,
 AtionForm actionForm, 
 HttpServletRequest httpServletRequest,
 HttpServletResponse httpServletResponse) throws Exception 


 CreateClientForm updateForm = (CreateClientForm)actionForm;

 // populate the bean here
 updateForm.setXXX( );
 updateForm.setYYY( );





-Ursprungligt meddelande-
Från: Ekberg Mats KONSULT 


[mailto:[EMAIL PROTECTED] 


Skickat: den 29 september 2005 11:41
Till: 'Struts Users Mailing List'
Ämne: SV: prepopulating jsp page





-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Skickat: den 29 september 2005 11:38

Till: user@struts.apache.org
Ämne: RE: prepopulating jsp page

Do this in your action:

  CreateClientForm updateForm = new CreateClientForm();
  // populate the bean here

  // then
  form = updateForm;

When you say 


form = updateForm;

what is my variable form of type?


 Form is the variable you got in your actions execute method:

   public ActionForward execute(ActionMapping actionMapping, 
ActionForm
actionForm, HttpServletRequest httpServletRequest, 


HttpServletResponse

httpServletResponse) throws Exception 








-Original Message-
From: Ekberg Mats KONSULT 


[mailto:[EMAIL PROTECTED] 


Sent: 29 September 2005 10:34
To: 'Struts Users Mailing List'
Subject: SV: prepopulating jsp page





-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Skickat: den 29 september 2005 11:26

Till: user@struts.apache.org
Ämne: prepopulating jsp page

Hi,

I am trying to pre-populate my JSP page with the values 


returned from

the database when a user edits a client. I have just 


recently upgraded

to Struts download 1.2.4.  

This is what I did before which worked: 

In my action class I created the form  then populated it with 
the values

from the DB.

CreateClientForm updateForm = new CreateClientForm();


Do this in your action:

  CreateClientForm updateForm = new CreateClientForm();
  // populate the bean here

  // then
  form = updateForm;






My struts config sent the response to the jsp page where I 
displayed the

values as follows



However in this new download the html tag library does not 


have a tag


for name.  Thus

AW: display checkbox with unique value using displaytag

2005-09-29 Thread R. Markham
Hi Michael,

it is not German sense of humor, because I really didn't understand what
Vijay wanted. You are right it took me longer than 30 min to grasp the
usesage of table decorators. I would have preferred an example in the
documentation of display tag for the problem described by vijay.

Regards

Richard



-Ursprüngliche Nachricht-
Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 29. September 2005 17:55
An: Struts Users Mailing List
Betreff: Re: display checkbox with unique value using displaytag

German sense of humor, he-he. Vijay, have you already read DisplayTag
manual? It is a well-written document, you will need no more than 30
minutes to start with decorators.

Michael.

On 9/29/05, R. Markham <[EMAIL PROTECTED]> wrote:
> Hi Vijay,
>
> I am wondering why do you want unique value in a check box. A checkbox has
> the values true or false.
>
> Regards
>
> Richard
>
> -Ursprüngliche Nachricht-
> Von: R.Vijayaraghavan [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 29. September 2005 12:05
> An: Struts Users Mailing List
> Betreff: display checkbox with unique value using displaytag
>
> Hello,
>
> I am using displaytag to display a table of records. I am able to add a
> checkbox as the first column using:
>
> 
> 
> 
>
> The problem is that I am not able to set a unique value for each checkbox.
I
> am having a column in the recordset stored in a RowSetDynaClass that has
the
> unique values for all the checkboxes. I just need to assign them
> appropriately.
>
> regards,
> vijay.
>
>
>
> -
> 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]



upgrade from Struts 1.0.2

2005-09-29 Thread Bob Paige
I am trying to upgrade an old Struts 1.0.2 application to a current 
version of Struts, but I'm finding some classes are not available:

- org.apache.struts.action.ActionMappings
- org.apache.struts.action.Action.ERROR_KEY
- org.apache.struts.digester.Digester
- org.apache.struts.digester.Rule
- org.apache.struts.util.BeanUtils
- org.apache.struts.util.PropertyUtils

Also, the 'getName()' method is no longer available on 
org.apache.struts.taglib.html.FormTag.


I tried looking through the mail archives for the past three years but 
didn't see any mention of these classes being removed. I suppose I could 
try opening all releases between 1.0.2 and the current one, looking for 
differences, but an emailed seemed quicker :)


Thanks for any pointers or help that can be offered.

--
Bobman


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 9/28/2005

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



RE: upgrade from Struts 1.0.2

2005-09-29 Thread Ainbinder Marina
Same is here. I am trying to upgrade from 1.1 to 1.2.4, but can not find
any documentation.
Some guidelines would be very helpful.

Thanks.

-Original Message-
From: Bob Paige [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 29, 2005 4:20 PM
To: user@struts.apache.org
Subject: upgrade from Struts 1.0.2


I am trying to upgrade an old Struts 1.0.2 application to a current 
version of Struts, but I'm finding some classes are not available:
- org.apache.struts.action.ActionMappings
- org.apache.struts.action.Action.ERROR_KEY
- org.apache.struts.digester.Digester
- org.apache.struts.digester.Rule
- org.apache.struts.util.BeanUtils
- org.apache.struts.util.PropertyUtils

Also, the 'getName()' method is no longer available on 
org.apache.struts.taglib.html.FormTag.

I tried looking through the mail archives for the past three years but 
didn't see any mention of these classes being removed. I suppose I could

try opening all releases between 1.0.2 and the current one, looking for 
differences, but an emailed seemed quicker :)

Thanks for any pointers or help that can be offered.

-- 
Bobman


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date:
9/28/2005

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


__
This e-mail has been scanned by Arbitron's Email Content Service.
__

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



Re: [OT] display checkbox with unique value using displaytag

2005-09-29 Thread Laurie Harper

R.Vijayaraghavan wrote:

Hello,

I am using displaytag to display a table of records. I am able to add a
checkbox as the first column using:





The problem is that I am not able to set a unique value for each checkbox. I
am having a column in the recordset stored in a RowSetDynaClass that has the
unique values for all the checkboxes. I just need to assign them
appropriately.


If your display:table is using the RowSetDynaClass as its data source, 
you can set uid="row" in the table tag, then set value with 
value="${row.someProperty}". See the displaytag documentation for 
information on the uid attribute.


L.


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



Re: SwitchAction.java in struts

2005-09-29 Thread Laurie Harper

Carl Smith wrote:

Can you describe in which case we should be using SwitchAction.java in struts? 
Can you offer some sample code? Is this used for multiple submit buttons (save, 
delete, update, cancle buttons for example) on one jsp page? Thanks.


I'm not sure what this has to do with CactusStrutsTestCase, but the 
answer is that SwitchAction is used for switching between modules -- 
specifically, for creating a link to a page in different module to the 
one containing the page the link appears on.


http://svn.apache.org/builds/struts/maven/trunk/site-test/struts-core/apidocs/org/apache/struts/actions/SwitchAction.html

L.


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



Re: upgrade from Struts 1.0.2

2005-09-29 Thread Wendy Smoak

From: "Ainbinder Marina" <[EMAIL PROTECTED]>


Same is here. I am trying to upgrade from 1.1 to 1.2.4, but can not find
any documentation.
Some guidelines would be very helpful.


http://wiki.apache.org/struts/StrutsUpgrade

Also check the release notes: 
http://struts.apache.org/userGuide/release-notes.html
(Follow the link in the first paragraph back until you get to the version 
you need.)


HTH,
--
Wendy Smoak 



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



RE: upgrade from Struts 1.0.2

2005-09-29 Thread Ainbinder Marina
Thanks a lot!

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 29, 2005 4:39 PM
To: Struts Users Mailing List
Subject: Re: upgrade from Struts 1.0.2


From: "Ainbinder Marina" <[EMAIL PROTECTED]>

> Same is here. I am trying to upgrade from 1.1 to 1.2.4, but can not 
> find any documentation. Some guidelines would be very helpful.

http://wiki.apache.org/struts/StrutsUpgrade

Also check the release notes: 
http://struts.apache.org/userGuide/release-notes.html
(Follow the link in the first paragraph back until you get to the
version 
you need.)

HTH,
-- 
Wendy Smoak 


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


__
This e-mail has been scanned by Arbitron's Email Content Service.
__

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



Multipart Form Validation

2005-09-29 Thread Brian Russell
Is there a reason I am losing my request parameters when returning
validation errors to a multipart form page?

 

I have a simple struts form. It has a few text fields and a file field. The
enctype is multipart/form-data on my form. I validate in the actionform's
validate method.  If the text fields are empty, I return errors that they
are required. Along with the visible fields, I pass a few hidden fields that
are needed as request params when the form is processed and returned to the
jsp. The jsp needs these request params. 

 

Everything works great when there are no validation errors as the request
params get returned by using the ActionRedirect class in the action. But if
there are errors returned, I lose the request params. (I am able to access
them in the actionform validate method or in the action). 

 

If I perform a test of 2 identical forms with a few required text fields,
one multipart one url-encoded, the url-encoded form maintains the request
params when validation errors are returned and the multipart form does not. 

 

What am I doing wrong? How can I make sure the request params are passed
back upon validation error in multipart form?

 

Thanks!



downloading a file using struts action class

2005-09-29 Thread temp temp
I want   a struts action class to download xml file .I
 do not want to use Struts DownloadAction because I
have a  super class  called AbstractActionBase  which
extends to  struts action class and all my action
classes extends to this AbstractActionBase. 

For downloading a file I am using normal struts action
class rather than DownloadAction class (I do not want
to use struts DownloadAction).
This normal struts action class returns null instead
of ActionForward  and sets the response content type
and writes to reponse output stream . My question is
is this proper way towrite a download Action  in
struts  without using struts DownloadAction class .


Here is the code fo my download action class 

public ActionForward performAction(
ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{

ResultsForm resultsForm = (ResultsForm)
request.getSession().getAttribute("resultsForm");
FMCDataDocument fmcDataDocument =
resultsForm.getIdFlagFmcDataDocument();
byte[] bytearray =
fmcDataDocument.xmlText().getBytes();
   
response.setContentType("application/rss+xml");
response.setContentLength(bytearray.length);
response.setHeader("Content-Disposition",
"attachment;filename=sample.xml");
response.getOutputStream().write(bytearray);
return null;
}


thanks & regards




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: upgrade from Struts 1.0.2

2005-09-29 Thread Bob Paige

Wendy Smoak wrote:


From: "Ainbinder Marina" <[EMAIL PROTECTED]>


Same is here. I am trying to upgrade from 1.1 to 1.2.4, but can not find
any documentation.
Some guidelines would be very helpful.



http://wiki.apache.org/struts/StrutsUpgrade

Also check the release notes: 
http://struts.apache.org/userGuide/release-notes.html
(Follow the link in the first paragraph back until you get to the 
version you need.)


HTH,


Thanks. This seems to address most of my questions, but I don't see any 
reference to a replacement for ActionMappings. I'll start working 
through my code with the newer libraries and dependencies (i.e. the 
digester was moved to a separate library) and maybe the ActionMappings 
thing will become more apparent.


This was a much quicker response than I anticipated!

--
Bobman


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 9/28/2005

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



Re: [shale] I miss ActionForward.. am I missing something?

2005-09-29 Thread Craig McClanahan
On 9/28/05, David Bowers <[EMAIL PROTECTED]> wrote:
>
> I am investigating using struts on an upcoming project, and I will need to
> figure out a way to port some of my custom struts security preprocessing
> to
> Shale. In my most current Struts implementation, I use a chain to test
> several attributes on a request to authenticate it, (things like cookies
> or
> whether the user needed authentication to view the current request) and
> establish the session. If I need to forward a user to some intermediate
> page
> for further security processing (like a login page), I changed the
> ActionConfig attribute on the ServletActionContext, and then allow the
> Chain
> to redirect the request according to what was I changed in the ActionChain
> attribute. (If this doesn't match exactly with the current 1.3 release,
> it's
> because I adapted the Chain part of it to Struts 1.2). I very much like
> this
> seperation, where my security preprocessing commands are only concerned
> with
> the Context, and I don't have to manipulate the Request in each Command
> that
> might need to forward, include, or redirect.
>
> As I look at shale, I don't see a way to do something similar. If I wanted
> any Command in my preprocessing chain to redirect a request or process
> something differently, it looks like I would have to manipulate the
> HttpRequest object manually. Of course, I could build my own ForwardBean,
> put that in the Context as a new attribute, and build my own machinery to
> process this, but it seems like what I'm doing is a pretty standard type
> of
> thing, and I'm wondering if I'm missing something since something like
> this
> does not exist.


It should not be necessary to manipulate the request object manually. The
"preprocess" chain is executed by ShaleApplicationFilter (as the name
implies) *before* FacesServlet is invoked ... and, from within a command,
you can do either a redirect or a forward in the usual way. The important
detail would be to make sure that your preprocessing command then returns
"true" instead of "false" ... this tells ShaleApplicationFilter that you
have already created the response, so it skips the usual chain.doFilter()
call that passes the request along to the original servlet.

To do a redirect:

HttpServletResponse hresponse = (HttpServletResponse) swcontext.getResponse
();
hresponse.sendRedirect("foo.jsp");
return true;

To do a forward:

ServletContext scontext = (ServletContext) swcontext.getContext();
RequestDispatcher rd = scontext.getRequestDispatcher("/foo.jsp");
rd.forward((ServletRequest) context.getRequest(),
(ServletResponse) context.getResponse());
return true;

It seems like a simple Forward bean could be included in the Shale
> framework, an attribute could be added to the ShaleWebContext for it, and
> the ShaleApplicationFilter could pay attention to it, at least for the
> preprocess part.
>
> Also, in my current struts implementation, I assign custom security
> attributes to each Action, and this is one of the things my custom
> preprocessor looks at. If I were to move to Shale, it looks like the best
> place to put these custom security attributes would on my backing beans,
> unless I wanted a whole new configuration file for these attributes, which
> I
> don't. Does that sound right?


That would make sense. Then you can use  settings in your
faces-bean.xml file to set the appropriate security values, without having
to hard code them.

Thanks in advance.
>
> David Bowers
>
>
Craig


Re: upgrade from Struts 1.0.2

2005-09-29 Thread Greg Reddin

On Sep 29, 2005, at 4:33 PM, Bob Paige wrote:

This was a much quicker response than I anticipated!


You'd be surprised how many people are trying to upgrade from 1.0.2 :-)

Greg


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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Murray Collingwood
I agree with Frank, we all started with Java/Struts somewhere and back then the 
more 
comments in the code made it so much easier for us to understand.  The people 
who 
come after us will also be learning, let's make it easier for them. 

The only time you should reduce comments is when your compiler times-out while 
parsing your source code.

Kind regards
mc

On 29 Sep 2005 at 12:20, Frank W. Zammetti wrote:

> On Thu, September 29, 2005 11:57 am, Dave Newton said:
> > Oh god remove the comments. Bottom line: if someone can't figure out
> > what's going on here w/o relying on the comments then they're fired.
> 
> Well now, *this* is a good way to go off-topic in a hurry Dave! :)
> 
> I personally feel just the opposite... the more comments the better, and I
> don't generally care how "pointless" they are... well, ok, if I see:
> 
> a++; // Add 1 to A
> 
> ... I tend to groan rather loudly, but that's a bit extreme :)  When your
> talking about all the myriad classes available in Java, it's virtually
> impossible to remember them all, what their methods do, etc.
> 
> For instance, take this line:
> 
> String s = s1.toUpperCase().trim().replace('A', '-');
> 
> Now, that's pretty straight-forward.  But, if someone added a comment:
> 
> // Convert s1 to all upper-case, trim whitespace from both ends and
> replace all A's with -'s and store result in s
> 
> I wouldn't frown upon that for two reasons... one, me looking at it
> doesn't have to remember what replace() does (i.e., does it replace ALL
> occurances of 'A' or just the first?) and two, it indicates that the
> developer who wrote it knew what he intended to do and wrote the code
> accordingly.
> 
> So for me, the more comments the better, even if they are commenting on
> what is an obvious thing for most.
> 
> Frank
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005


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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Murray Collingwood wrote:

I agree with Frank, we all started with Java/Struts somewhere and back then the more 
comments in the code made it so much easier for us to understand. 


If you're documenting functionality, I totally agree.

If you're commenting "inputStream.read(xxx)" with "read in the bytes" I 
couldn't disagree more.


Dave



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



tag question about identifying a specific item in a collection

2005-09-29 Thread Mick Knutson
I have a collection of cards. and I want to create a table fo thos
cards, but if I get to a card where foo=bar, then I want to paint that
row as a form with updateable fields and 1 submit for just that row.
How would I do this please?

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


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



Struts hangs on

2005-09-29 Thread Dave Bender
I'm having a problem where Struts has begun 'hanging on' to Web browser
requests.  I'll call up an Action and the page comes back pretty instantly,
as you'd expect, but the little 'still-downloading' image keeps whirling for
about 30 seconds.   I've tried to track this down thorough my debugger but
the request flies through to the end of the Action.execute() method, where I
return a forward.   Sometime after that it hangs for about 30 seconds, then
the request completes.  This happens for all Actions in the project.  I'm
using Tiles, if that makes a difference.

Does this symptom sound familiar to anyone?  Any suggestions would be
appreciated.

Dave Bender




Re: [OT] Re: writing images from a database

2005-09-29 Thread Norris Shelton
Yes and no.  

If it's his production code no, but if it's a how-to or
something that goes in a wiki, it should leave no details
uncovered.  

It is better to be over-documented, than under.  Also, I would
use the full package name on objects.  Nothing is more fun than
trying to figure out an object when it's in more than one
package (like ALL the client certificate code) or it's in some
library that you have never seen.

--- Dave Newton <[EMAIL PROTECTED]> wrote:

> Murray Collingwood wrote:
> 
> >I agree with Frank, we all started with Java/Struts somewhere
> and back then the more 
> >comments in the code made it so much easier for us to
> understand. 
> >
> If you're documenting functionality, I totally agree.
> 
> If you're commenting "inputStream.read(xxx)" with "read in the
> bytes" I 
> couldn't disagree more.
> 
> Dave
> 
> 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Appriss, Inc.
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Frank W. Zammetti

Let me ask this question... what's the HARM in "read in the bytes"?

Murray, have you ever actually had a compiler choke on a source file 
because of comments?!?  *That* might be the harm indeed! :)


Frank

Dave Newton wrote:

Murray Collingwood wrote:

I agree with Frank, we all started with Java/Struts somewhere and back 
then the more comments in the code made it so much easier for us to 
understand.


If you're documenting functionality, I totally agree.

If you're commenting "inputStream.read(xxx)" with "read in the bytes" I 
couldn't disagree more.


Dave



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




.



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Frank W. Zammetti wrote:


Let me ask this question... what's the HARM in "read in the bytes"?


Having comments that are superfluous:
(a) still requires brain processing, and my brain is in short supply :/
(b) obscures what's actually being done (see note below)
(c) requires maintenance

Note: If comments like that are well to the right and justified along 
some far-right column I'd be slightly mollified as it keeps them out of 
the way.


...but I've never been through a code review where those comments 
wouldn't have been tagged for deletion. They're just not helpful (in 
this specific case).


Murray, have you ever actually had a compiler choke on a source file 
because of comments?!?


I tweaked a compiler during college to do fun things when it encountered 
naughty words in comments. That was fun.


Dave



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



Re: tag question about identifying a specific item in a collection

2005-09-29 Thread Murray Collingwood
Will the following work?



 
   
   
 
 
   
 



Kind regards
mc
  

On 29 Sep 2005 at 15:41, Mick Knutson wrote:

> I have a collection of cards. and I want to create a table fo thos
> cards, but if I get to a card where foo=bar, then I want to paint that
> row as a form with updateable fields and 1 submit for just that row.
> How would I do this please?
> 
> --
> 
> Thanks
> Mick Knutson
> (925) 951-4126
> HP Consulting Services
> Safeway (Blackhawk Fastword Project)
> J2EE Architect
> ---
> 
> 
> 
> "MMS " made the following annotations.
> --
> Warning: 
> All e-mail sent to this address will be received by the Safeway corporate 
> e-mail 
system, and is subject to archival and review by someone other than the 
recipient.  This 
e-mail may contain information proprietary to Safeway and is intended only for 
the use 
of the intended recipient(s).  If the reader of this message is not the 
intended 
recipient(s), you are notified that you have received this message in error and 
that any 
review, dissemination, distribution or copying of this message is strictly 
prohibited.  If 
you have received this message in error, please notify the sender immediately. 
>   
> 
=
=
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005


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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Norris Shelton wrote:


It is better to be over-documented, than under.  Also, I would
use the full package name on objects.  Nothing is more fun than
trying to figure out an object when it's in more than one
package (like ALL the client certificate code) or it's in some
library that you have never seen.
 

Slightly agree, but again, in general, this usually over-obfuscates (for 
me, anyway :)


Part of why I say that is because I almost never touch Java code outside 
of an IDE these days: I hover, it tells me what I need to know; I 
double-click an can go to the declaration, etc.


I'd probably use a comment here rather than messing with the mainline 
code, though.


In my own code it's pretty rare I'll have an in-line comment. I'll 
comment large functional blocks of code, and I JavaDoc most everything 
pretty thoroughly (except packages, which I need to get in the habit 
of). That said I rarely have methods that are very long, I use 
descriptive variable and method names, and that seems to eliminate most 
confusion.


Dave



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



[OT] Re: writing images from a database

2005-09-29 Thread Murray Collingwood
On 29 Sep 2005 at 19:11, Frank W. Zammetti wrote:
> Murray, have you ever actually had a compiler choke on a source file 
> because of comments?!?  *That* might be the harm indeed! :)

There were a couple of times when I had to consider the cost of disk space vs 
the value 
of a program.  When the comments in your source code start consuming gigabytes 
of 
disk space I think everybody should start asking these same questions and 
not 
before.  ;-)

Kind regards
mc




FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005


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



RE: [OT] Re: writing images from a database

2005-09-29 Thread Braun, James F
In my defense:
a) I'm new to struts
b) It's a How-To document to be read by others in our team, or myself at
3am when not all neurons are firing at their best.

I'm reminded of the guide on Mt Everest who said, "If they need my help,
they shouldn't be here!" That was the year 17 people died.

I never did get any suggestion as to where to post this (and others) to
any archive site and now I'm not sure if it's worthy.


J.

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 29, 2005 7:25 PM
To: Struts Users Mailing List
Subject: Re: [OT] Re: writing images from a database

Frank W. Zammetti wrote:

> Let me ask this question... what's the HARM in "read in the bytes"?

Having comments that are superfluous:
(a) still requires brain processing, and my brain is in short supply :/
(b) obscures what's actually being done (see note below)
(c) requires maintenance

Note: If comments like that are well to the right and justified along
some far-right column I'd be slightly mollified as it keeps them out of
the way.

...but I've never been through a code review where those comments
wouldn't have been tagged for deletion. They're just not helpful (in
this specific case).

> Murray, have you ever actually had a compiler choke on a source file 
> because of comments?!?

I tweaked a compiler during college to do fun things when it encountered
naughty words in comments. That was fun.

Dave



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


-- 
This transmission is intended only for use by the addressee(s) named herein and 
may contain information that is proprietary, confidential and/or legally 
privileged. If you are not the intended recipient, you are hereby notified that 
any disclosure, copying, distribution, or use of the information contained 
herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received 
this transmission in error, please immediately contact the sender and destroy 
the material in its entirety, whether in electronic or hard copy format. Thank 
you.



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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dave Newton

Braun, James F wrote:


In my defense:
 

No need--we go off on these dumb tangents (well, _I_ do, anyway) all the 
time. It's just one of those stupid religious flamewars.



I'm reminded of the guide on Mt Everest who said, "If they need my help,
they shouldn't be here!" That was the year 17 people died.
 

Due in no small part to some BAD decisions. Very irritating to lose 
acquaintances that way, but we in the climbing community are used to it :/



I never did get any suggestion as to where to post this (and others) to
any archive site and now I'm not sure if it's worthy.
 


Yeah you did; on the wiki :)

And don't worry, I won't go in and edit the comments out! :D

Dave



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



Re: tag question about identifying a specific item in acollection

2005-09-29 Thread Mick Knutson
Thanks so much!

Murray Collingwood wrote:

> Will the following work?
>
> 
> 
>  
>
>
>  
>  
>
>  
> 
> 
>
> Kind regards
> mc
>
>
> On 29 Sep 2005 at 15:41, Mick Knutson wrote:
>
> > I have a collection of cards. and I want to create a table fo thos
> > cards, but if I get to a card where foo=bar, then I want to paint that
> > row as a form with updateable fields and 1 submit for just that row.
> > How would I do this please?
> >
> > --
> >
> > Thanks
> > Mick Knutson
> > (925) 951-4126
> > HP Consulting Services
> > Safeway (Blackhawk Fastword Project)
> > J2EE Architect
> > ---
> >
> >
> >
> > "MMS " made the following annotations.
> > --
> > Warning:
> > All e-mail sent to this address will be received by the Safeway corporate 
> > e-mail
> system, and is subject to archival and review by someone other than the 
> recipient.  This
> e-mail may contain information proprietary to Safeway and is intended only 
> for the use
> of the intended recipient(s).  If the reader of this message is not the 
> intended
> recipient(s), you are notified that you have received this message in error 
> and that any
> review, dissemination, distribution or copying of this message is strictly 
> prohibited.  If
> you have received this message in error, please notify the sender immediately.
> >
> >
> =
> =
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
> >
>
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


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



PHP integration

2005-09-29 Thread Jim Douglas

To all,

I am trying to integrate PHP into a struts/tiles website.  The website is 
running fine, and has been.


When I put the month.php file in my struts.xml file, like this,


 
 


...the php code comes back to the browser.  I can deploy PHP pages no 
problem but I can't get it working with Struts.


I can start and restart the bridge successfully.  What do I need to 
configure?



I have the following configuration,
PHP 5.0.5
Fedora 4
Apache 2.0.54
Tomcat 4.?
the jave-php bridge 2.0.8 (the latest version)


Jim



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



Lazy again

2005-09-29 Thread Martin Ravell
I'm just getting back to looking at my lazy loading problem and would like
to see if I am understanding things correctly. While not strictly Struts
related (I do use Struts in this app) I am hoping that someone else on this
list has gone down the same path as I am attempting.

My web.xml has the following section in it:


  hibernateFilter
 
org.springframework.orm.hibernate3.support.OpenSessionInViewFi
lter 



  hibernateFilter
  *.spring



I have also tried other patterns than *.spring (as I was unsure if this was
correct.

When attempting to access objects in the jsp that have come from hibernate I
am still getting :

[LazyInitializationException] could not initialize prozy - the owning
Session was closed

Originally I was using Hibernate 2 and had tried the similar
OpenSessionInViewFilter that is meant for that version. Same problem.

Any ideas?

Am I correct in thinking that if the filter is working correctly I should be
able to grab an object from my DAO layer in an Action, put it into the
session or request scope and have my jsp page access it's related objects
(with lazy loading)?

What mechanism opens and closes these Hibernate sessions? I thought it was
supposed to be all done by the filter?

PS. I do use Tiles with my Struts if this makes any difference.



Regards
Marty




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



Re: [Hibernate] Lazy again

2005-09-29 Thread Murray Collingwood
Hi Martin

I'm not using spring, not sure if I should be.  I recently tried writing an app 
using 
Hibernate and had some great experiences - it's pretty cool in the amount of 
code and 
development time it saves me.

Having said that I'm struggling with the same problem.  I open the Hibernate 
session in 
my Action class, update / access the data and then close the session.  I get 
the "session 
is closed" when the page begins to render properties from my bean (where those 
properties originated from related tables).

Reading through the Hibernate manual it indicated that by specifying 
fetch="join" the 
related table would be retrieved in the same select statement.  I tried this 
but got the 
same "session is closed" result.  It also said that you could specify 
lazy="false" and it 
would retrieve everything at once, however it immediately recommends you don't 
do 
this for lots of good reasons (I did try some but they didn't seem to work, 
maybe I put 
them in the wrong place).

How does the filter modify this process for you?  It doesn't sound like it has 
solved the 
problem.

Kind regards
mc


On 30 Sep 2005 at 10:30, Martin Ravell wrote:

> I'm just getting back to looking at my lazy loading problem and would like
> to see if I am understanding things correctly. While not strictly Struts
> related (I do use Struts in this app) I am hoping that someone else on this
> list has gone down the same path as I am attempting.
> 
> My web.xml has the following section in it:
> 
> 
>   hibernateFilter
>  
> org.springframework.orm.hibernate3.support.OpenSessionInViewFi
> lter 
> 
> 
> 
>   hibernateFilter
>   *.spring
> 
> 
> 
> I have also tried other patterns than *.spring (as I was unsure if this was
> correct.
> 
> When attempting to access objects in the jsp that have come from hibernate I
> am still getting :
> 
> [LazyInitializationException] could not initialize prozy - the owning
> Session was closed
> 
> Originally I was using Hibernate 2 and had tried the similar
> OpenSessionInViewFilter that is meant for that version. Same problem.
> 
> Any ideas?
> 
> Am I correct in thinking that if the filter is working correctly I should be
> able to grab an object from my DAO layer in an Action, put it into the
> session or request scope and have my jsp page access it's related objects
> (with lazy loading)?
> 
> What mechanism opens and closes these Hibernate sessions? I thought it was
> supposed to be all done by the filter?
> 
> PS. I do use Tiles with my Struts if this makes any difference.
> 
> 
> 
> Regards
> Marty
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005


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



Fw: Error verifying struts-1.2.7.zip

2005-09-29 Thread Niall Pemberton
Forwarding to the user list

I'm a pgp novice, can anyone help with this? Running pgp on windows, it all
seems fine to me - it verifies the struts-1.2.7.zip.asc file no problem, but
then my key is already in my key store.

Niall

- Original Message - 
From: "Bailey, Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 29, 2005 4:55 PM
Subject: Error verifying struts-1.2.7.zip


Hello Niall,

We're looking to upgrade to the new version of struts.  We followed the
procedures on the apache download site and downloaded the necessary files.
I installed all the necessary keys in the KEYS file.  When I tried to verify
the zip file using PGP I got the following error...

pgp --verify c:\temp\struts-1.2.7.zip.asc

Decoding data
Verifying detached signature in file 'c:\temp\struts-1.2.7.zip.asc' against
file 'c:\temp\struts-1.2.7.zip'
WARNING: Bad signature, doesn't match file contents!

Bad signature file from user "Niall Pemberton (Code signing)
<[EMAIL PROTECTED]>"
Error decrypting file 'c:\temp\struts-1.2.7.zip.asc'

I've tried downloading and redownloading the zip file and the signature file
like 3 times with no luck.  You wouldn't happen to have any queestions would
you.  Any help you could provide would be appreciated.

Thanks.

Mike Bailey



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



Re: Fw: Error verifying struts-1.2.7.zip

2005-09-29 Thread Rahul Akolkar
On 9/29/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
> Forwarding to the user list
>
> I'm a pgp novice, can anyone help with this? Running pgp on windows, it all
> seems fine to me - it verifies the struts-1.2.7.zip.asc file no problem, but
> then my key is already in my key store.


Looks good to me, downloaded from the tux.org mirror.

W:\>gpg --import NIALL_KEY
gpg: key C56014B2: public key "Niall Pemberton (Code signing)
<[EMAIL PROTECTED]>" imported
gpg: Total number processed: 1
gpg:   imported: 1

W:\>gpg --verify struts-1.2.7.zip.asc
gpg: Signature made 05/06/05 08:43:21 using DSA key ID C56014B2
gpg: Good signature from "Niall Pemberton (Code signing) <[EMAIL PROTECTED]>"



But I don't trust you (yet), as seen below ;-)

gpg: WARNING: This key is not certified with a trusted signature!
gpg:  There is no indication that the signature belongs to the owner.


-Rahul

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



Re: Fw: Error verifying struts-1.2.7.zip

2005-09-29 Thread Niall Pemberton
Thanks Rahul,

I don't always trust me either :-)

Niall

- Original Message - 
From: "Rahul Akolkar" <[EMAIL PROTECTED]>
Sent: Friday, September 30, 2005 2:06 AM


On 9/29/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
> Forwarding to the user list
>
> I'm a pgp novice, can anyone help with this? Running pgp on windows, it
all
> seems fine to me - it verifies the struts-1.2.7.zip.asc file no problem,
but
> then my key is already in my key store.


Looks good to me, downloaded from the tux.org mirror.

W:\>gpg --import NIALL_KEY
gpg: key C56014B2: public key "Niall Pemberton (Code signing)
<[EMAIL PROTECTED]>" imported
gpg: Total number processed: 1
gpg:   imported: 1

W:\>gpg --verify struts-1.2.7.zip.asc
gpg: Signature made 05/06/05 08:43:21 using DSA key ID C56014B2
gpg: Good signature from "Niall Pemberton (Code signing)
<[EMAIL PROTECTED]>"



But I don't trust you (yet), as seen below ;-)

gpg: WARNING: This key is not certified with a trusted signature!
gpg:  There is no indication that the signature belongs to the
owner.


-Rahul

-
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: writing images from a database

2005-09-29 Thread Dakota Jack
Actually, if you are going to build a servlet with this capacity, it
should handle all such resources, not just images.  You can, e.g.,
make big savings with using these for CSS, etc.

On 9/29/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> On 9/29/05, Braun, James F <[EMAIL PROTECTED]> wrote:
> > With the help of this list and some digging I think I came up with a
> > relatively elegant solution (subject to expert critique which is
> > welcome). I don't know if attachments are allowed on this list so I've
> > included the how-to I write up for myself after every quest of this
> > sort. Any suggestions on how to improve this would be appreciated.
>
> 
>
> Whoa, a whole action class and a form bean for one measly picture. Too
> much even for me. I would prefer something more simpler and generic,
> like a servlet with image name as parameter.
>
> Michael.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dakota Jack
I think the idea is to make code clear.  If you cannot possibly make
the code clear without comments, then put the comments into the code. 
Gratuitous comments are counter-productive.

On 9/29/05, Dave Newton <[EMAIL PROTECTED]> wrote:
> Frank W. Zammetti wrote:
>
> > Let me ask this question... what's the HARM in "read in the bytes"?
>
> Having comments that are superfluous:
> (a) still requires brain processing, and my brain is in short supply :/
> (b) obscures what's actually being done (see note below)
> (c) requires maintenance
>
> Note: If comments like that are well to the right and justified along
> some far-right column I'd be slightly mollified as it keeps them out of
> the way.
>
> ...but I've never been through a code review where those comments
> wouldn't have been tagged for deletion. They're just not helpful (in
> this specific case).
>
> > Murray, have you ever actually had a compiler choke on a source file
> > because of comments?!?
>
> I tweaked a compiler during college to do fun things when it encountered
> naughty words in comments. That was fun.
>
> Dave
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dakota Jack
This is directly contrary to best practices.  What really would have
helped in Struts would have been if someone had discussed some of the
naming conventions prior to committing them.  They are particularly
bad in Struts.  However, best practices is to make the code clear
first.  If that is not possible, only then comment.  OP

On 9/29/05, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> I agree with Frank, we all started with Java/Struts somewhere and back then 
> the more
> comments in the code made it so much easier for us to understand.  The people 
> who
> come after us will also be learning, let's make it easier for them.
>
> The only time you should reduce comments is when your compiler times-out while
> parsing your source code.
>
> Kind regards
> mc
>
> On 29 Sep 2005 at 12:20, Frank W. Zammetti wrote:
>
> > On Thu, September 29, 2005 11:57 am, Dave Newton said:
> > > Oh god remove the comments. Bottom line: if someone can't figure out
> > > what's going on here w/o relying on the comments then they're fired.
> >
> > Well now, *this* is a good way to go off-topic in a hurry Dave! :)
> >
> > I personally feel just the opposite... the more comments the better, and I
> > don't generally care how "pointless" they are... well, ok, if I see:
> >
> > a++; // Add 1 to A
> >
> > ... I tend to groan rather loudly, but that's a bit extreme :)  When your
> > talking about all the myriad classes available in Java, it's virtually
> > impossible to remember them all, what their methods do, etc.
> >
> > For instance, take this line:
> >
> > String s = s1.toUpperCase().trim().replace('A', '-');
> >
> > Now, that's pretty straight-forward.  But, if someone added a comment:
> >
> > // Convert s1 to all upper-case, trim whitespace from both ends and
> > replace all A's with -'s and store result in s
> >
> > I wouldn't frown upon that for two reasons... one, me looking at it
> > doesn't have to remember what replace() does (i.e., does it replace ALL
> > occurances of 'A' or just the first?) and two, it indicates that the
> > developer who wrote it knew what he intended to do and wrote the code
> > accordingly.
> >
> > So for me, the more comments the better, even if they are commenting on
> > what is an obvious thing for most.
> >
> > Frank
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005
> >
>
>
>
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.8/114 - Release Date: 28/09/2005
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: [OT] Re: writing images from a database

2005-09-29 Thread Dakota Jack
Lord, if there were gigabytes of comments that would be bad. 
Horrible.  A disaster.  Something to cry about.  However, there are
not.  So that is good.  Very good.  Something to smile about.  If
there is anything like a whole bunch of comments, that is the sign of
an amateur and the same is true about no comments and unreadable code.

On 9/29/05, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> On 29 Sep 2005 at 19:11, Frank W. Zammetti wrote:
> > Murray, have you ever actually had a compiler choke on a source file
> > because of comments?!?  *That* might be the harm indeed! :)
>
> There were a couple of times when I had to consider the cost of disk space vs 
> the value
> of a program.  When the comments in your source code start consuming 
> gigabytes of
> disk space I think everybody should start asking these same questions and 
> not
> before.  ;-)
>
> Kind regards
> mc
>
>
>
>
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: [Hibernate] Lazy again

2005-09-29 Thread Joe Germuska
Reading through the Hibernate manual it indicated that by specifying 
fetch="join" the
related table would be retrieved in the same select statement.  I 
tried this but got the
same "session is closed" result.  It also said that you could 
specify lazy="false" and it
would retrieve everything at once, however it immediately recommends 
you don't do
this for lots of good reasons (I did try some but they didn't seem 
to work, maybe I put

them in the wrong place).

How does the filter modify this process for you?  It doesn't sound 
like it has solved the

problem.


The filter opens a single session as early as possible in the servlet 
request, and closes it as late as possible; this lets you write most 
of your code trusting that there is a current session which relates 
to recently retrieved objects.  Google for "Open Session In View" and 
you'll find lots and lots of writeups about this pattern.


Regarding Martin's question, the filter should be mapped to whatever 
your Struts actions are mapped (as in the conventional *.do) if you 
want your Struts actions and the views to which they forward to take 
advantage of the filter.


I've been using Hibernate for a little while and have adopted the 
Open Session in View pattern for the application I'm currently 
developing.  There are definitely a few things you need to get used 
to, so it is worth doing a decent amount of reading.  In fact, I 
would say that while you can do a good amount with Hibernate without 
much study, there is much careful thought behind the framework and 
you will use it much better if you learn the reasoning behind some of 
the implementation decisions. (Hibernate in Action, written by 
Hibernate founder Gavin King, is a very fine book; one of the most 
usefully theoretical technical books I've read in a long time.)


If you have a relatively simple object model, you can do just fine 
without "Open Session In View" -- just make sure that all your 
associations are marked as non-lazy or explicitly indicate the Fetch 
Mode in queries when you know that the associations will be followed, 
or use Hibernate.initialize(...) to make sure that the initialization 
happens (remember that it is not recursive, so you need to apply it 
to each lazy collection, and you must do it before the opening 
session has been closed, or you must use session.lock(...) to 
reattach your detached persistent objects before trying to traverse 
lazy associations.  (If this all sounds like gibberish, read 
Hibernate in Action!)


Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex


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



Hibernate data at startup

2005-09-29 Thread Martin Ravell
I have Menu information for my app in the database which I would like to be
able to load somehow when my app server starts up (or app is deployed). This
would be much more efficient than the current method of having each user
load it when they enter the application.

Can anyone suggest how to best go about doing this? The architecture is
Struts, Hibernate and Spring.


Thanks
Marty




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



Re: Hibernate data at startup

2005-09-29 Thread Nick Heudecker
You have a few options. To initialize Spring, you can either use the Struts
plugin or the web app context listener. Once that's done you can either use
a startup servlet or a Struts plugin to load the data and put it into the
servlet context. That way it only needs to be loaded once and is shared
throughout the application.

It's pretty simple, but not very obvious.


On 9/30/05, Martin Ravell <[EMAIL PROTECTED]> wrote:
>
> I have Menu information for my app in the database which I would like to
> be
> able to load somehow when my app server starts up (or app is deployed).
> This
> would be much more efficient than the current method of having each user
> load it when they enter the application.
>
> Can anyone suggest how to best go about doing this? The architecture is
> Struts, Hibernate and Spring.
>
>
> Thanks
> Marty
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Problems with nested beans and displaying information in a dropdown box

2005-09-29 Thread Justin Galzic
I have a form that contains a bean with a nested collection that I'd like to
prepopulate but I'm having trouble displaying the correct information.. The
output html wiould ideally look like this:

Jon Doe
Jeff Newworth
Amy Madigan


The ActionForm contains the bean with nested beans and the error mesage I
get from Tomcat is "Cannot find bean under name customer".

My form and bean classes are defined as:

public CustomerFormBean extends ActionForm
{
   CustomerBase getCustomerBase() { return customerBase; }
   private CustomerBase customerBase;
}

public class CustomerBase
{
   public Object[] getCustomers() { return customers.toArray(); }
   private ArrayList customers;
}

public class Customer
{
   public String getName() { return name; }
   public String getId() { return id; }

}


My jsp code looks like this:

   










Could some one point me toward the right direction in helping me understand
what's wrong here?

Thanks,
Justin


Hibernate data

2005-09-29 Thread Ankit Pancholi

Hi
I am a complete new user of struts and have joined this group to get
more info on struts. I have heard lots about hibernation. Can any one
direct me to a documentation or someplace where I can get the info about
wat and how hibernation is used.
Thanks
ankit

 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

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



Re: Hibernate data

2005-09-29 Thread Justin Galzic
http://hibernate.org/ is a good place start. There's also a book called
'Hibernate In Action' published by Manning Publications that might be
helpful to you.

Justin

On 9/29/05, Ankit Pancholi <[EMAIL PROTECTED]> wrote:
>
>
> Hi
> I am a complete new user of struts and have joined this group to get
> more info on struts. I have heard lots about hibernation. Can any one
> direct me to a documentation or someplace where I can get the info about
> wat and how hibernation is used.
> Thanks
> ankit
>
>  CAUTION - Disclaimer *
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful. This
> e-mail may contain viruses. Infosys has taken every reasonable precaution to
> minimize this risk, but is not liable for any damage you may sustain as a
> result of any virus in this e-mail. You should carry out your own virus
> checks before opening the e-mail or attachment. Infosys reserves the right
> to monitor and review the content of all messages sent to or from this
> e-mail address. Messages sent to or from this e-mail address may be stored
> on the Infosys e-mail system.
> ***INFOSYS End of Disclaimer INFOSYS***
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>