design question

2003-12-24 Thread dirk
I have 3 FormObjects.
I have a newuser.jsp page containing the form userForm, in this form i put a 
javascript button with an onclick event, window.open with a popup (adresuser.jsp), 
with the form adresUserForm.  Finally i have on the userForm another javascript button 
with a popup to specialinfo.jsp. This page contains the specialInfoForm. After closing 
these popups i want to have one action ( submitting the userForm ). How can i get the 
values from the 2 other formObjects ? Is there anybody that has a similar problem ... 
Thanks !

Re: design question

2003-12-24 Thread Gurpreet Dhanoa
hi Drik

once the user have filled up the other 2 forms in the pop window
u can make object of those two forms into your final action and can get the
values
like

Form1 form=new Form1();

Form2 form2=new Form2();

from1.getUserAddress();

from1.getCity();


Hope this works

Regards
Gurpreet Dhanoa

- Original Message -
From: dirk [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 2:54 PM
Subject: design question


I have 3 FormObjects.
I have a newuser.jsp page containing the form userForm, in this form i put a
javascript button with an onclick event, window.open with a popup
(adresuser.jsp), with the form adresUserForm.  Finally i have on the
userForm another javascript button with a popup to specialinfo.jsp. This
page contains the specialInfoForm. After closing these popups i want to have
one action ( submitting the userForm ). How can i get the values from the 2
other formObjects ? Is there anybody that has a similar problem ... Thanks !


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



RE: PDF file in browser

2003-12-24 Thread shirishchandra.sakhare
Hi,
Also do not forget to set the header so that the save as dialogue box is displayed in 
IE...For that you have to set the content-disposition header ..
following is the  code from our project..


Class  FileOpenAction{

protected final void returnBinaryFile(
HttpServletResponse response,
String filename
String saveAsName)
throws FileNotFoundException, IOException {
response.setContentType(mimeType);
String fileExt = 
WebUtil.getFileExtensionFromMIMEType(application/pdf);
setSaveAsHeader(response,saveAsName,fileExt);
File file = new File(filename);
response.setContentLength((int) file.length());

FileInputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] buf = new byte[4096];
int count = 0;

while ((count = in.read(buf)) = 0) {
out.write(buf, 0, count);
}

in.close();
out.close();
}

public static void setSaveAsHeader(HttpServletResponse response,String 
saveAsFileName,String fileExt){
if(saveAsFileName == null){
return;
}
//to get over a problem in browsers due to which the file name must 
have proper extension
if((fileExt != null)|| (fileExt.length() !=0)){
int index1 = saveAsFileName.indexOf(fileExt.toUpperCase());
int index2 = saveAsFileName.indexOf(fileExt.toLowerCase());
if((index1 == -1) (index2 == -1)){
saveAsFileName = saveAsFileName + . + fileExt;
}
}
response.addHeader(Content-Disposition, attachment; filename= + 
saveAsFileName ); 
}   
}

Also another thought..Why use another servlet..Just use another action like we 
do..This way you can use all the existing framwroek..Like authorisation etc

-Original Message-
From: Surachai Locharoen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 10:41 PM
To: Struts Users Mailing List
Subject: Re: PDF file in browser


Additionally, In struts framework you have to reset request header before by
call


request.reset();
request.setContentType(application/pdf);
request.setContentLength(byte.length);



- Original Message -
From: Navjot Singh [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:53 PM
Subject: RE: PDF file in browser


 if you can reveal the location of the PDFs on your web server.
 Simply put your pdfs under a www/app.com/pdfs/*.pdf and give them links as
 you want.

 if you wish to maintain some security.
 1. send a request to a servlet wit some pdf code or file name
 2. open the given file from the file system whereever it is.
 3. convert it into stream.
 4. push the stream back to browser.

 note - must set the appropraite mime/type before you push the stream back.
 may be application/pdf or application/x-pdf

 HTH
 Navjot Singh

 -Original Message-
 From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 10:50 AM
 To: 'Struts Users Mailing List'
 Subject: PDF file in browser
 
 
 
 
 Hi All,
 
  I am using Struts frame work for our application with Web sphere
 app server.
 We have a some PDF files on the app server .When the user clicks on a
 particular link on
 the JSP page, we have show a pdf  file to the user in a new browser
 window.
 Can any one pls tell me the easier procedure to do this??
 
 Regards
 VasudevRaoGupta
 
 
 Confidentiality Notice
 
 The information contained in this electronic message and any
 attachments to this message are intended
 for the exclusive use of the addressee(s) and may contain
 confidential or privileged information. If
 you are not the intended recipient, please notify the sender at
 Wipro or [EMAIL PROTECTED] immediately
 and destroy all copies of this message and any attachments.
 
 -
 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: design question

2003-12-24 Thread Mark Lowe
If the forms are in different windows then instantiating new forms I 
dont think will work. If you want a non javascript way of doing things 
then you'll want to scope the master form to the session, and then keep 
populating to from your subforms .

However you do this I imagine that scoping the master form to session 
is the way forward and retrieving and populating it in the actions 
processing your secondary forms.

action path=/master name=masterForm scope=session...

action path=/gimp/submit name=gimpForm scope=request 
type=com.sparrow.struts.GimpAction..

You could make one form property of the master form of type gimpform or 
store this  as a map.

html:form action=/gimp/submit.do

public GimpAction ...
GimpForm gimpForm = (GimpForm) form;
MasterForm masterForm = (MasterForm) session.getAttribute(masterForm);
masterForm.setGimp(gimpForm);
or if you're using a map to store the properties of gimp in your 
masterForm

Map gimpMap = BeanUtils.describe(gimpForm);
masterForm.setGimp(gimpMap);
Hope this helps

Mark

On 24 Dec 2003, at 09:50, Gurpreet Dhanoa wrote:

hi Drik

once the user have filled up the other 2 forms in the pop window
u can make object of those two forms into your final action and can 
get the
values
like

Form1 form=new Form1();

Form2 form2=new Form2();

from1.getUserAddress();

from1.getCity();

Hope this works

Regards
Gurpreet Dhanoa
- Original Message -
From: dirk [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 2:54 PM
Subject: design question
I have 3 FormObjects.
I have a newuser.jsp page containing the form userForm, in this form i 
put a
javascript button with an onclick event, window.open with a popup
(adresuser.jsp), with the form adresUserForm.  Finally i have on the
userForm another javascript button with a popup to specialinfo.jsp. 
This
page contains the specialInfoForm. After closing these popups i want 
to have
one action ( submitting the userForm ). How can i get the values from 
the 2
other formObjects ? Is there anybody that has a similar problem ... 
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]


Re: Synchronise Collection with ActionForm

2003-12-24 Thread François Richard
the solution :
in the logic:iterate the id must be choosen carefully ... you have 
to use the same value as property
I found the explanation here (/Indexed References/) :
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#doc.Properties

for me :
html:form action=societeValid
logic:iterate id=societes name=societeForm property=societes 
scope=session indexId=index
html:text name=societes property=code indexed=true /
html:text name=societes property=raisonSociale indexed=true /
/logic:iterate
/html:form

François Richard wrote:

Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object  form html) works great, 
on page load.
but, on form submitting, the second synchronization (form html  
ActionForm object)doesn't work. the old values are still present.

The ActionForm (SocieteForm) object is stocked in the session.

my jsp :

html:form action=societeValid
logic:iterate id=societe name=societeForm property=societes 
scope=session indexId=index
html:text name=societe property=code indexed=true /
html:text name=societe property=raisonSociale indexed=true /
/logic:iterate
/html:form

Thanks,

François



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


Navigation Stack

2003-12-24 Thread Guillermo Meyer
Hi:
I'm working with a Struts 1.0 application. I extended Action to create a
base action that handles backwards navigation in a stack fashion.
Each method calls a saveStep method to the stack. This step has form,
mapping and dispatch name. Base action has a method called stepBack
that can be called from the browser by clicking the back button (not
browser back button, but a submit button). This stepBack method executes
the last step in the stack and goes backwards. Another features exists
like checkPoint step, and an undoStep to return from a validation in
Validator Form.

public ActionForward stepBack(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws Exception {
NavigationStack ns =
this.retrieveNavigationStack(request);
synchronized(ns) {
//if not reloading
StackStep ss = null;
if(this.isTokenValid(request)) {
try {
  ns.pop(); //last step, ignore it.
ss = ns.pop();
} catch (Exception e){
   return this.handleEmptyStack(mapping, form, request,
response);
}
} else {
ss = ns.getLastPopped();
}
return ss.process(request, response);
}
}

public void saveStep(ActionMapping mapping, ActionForm form,
HttpServletRequest req, String dispatchName, boolean isCheckPoint) {
//si no se indicó invalidar el grabado...
if(this.isStepValid(req)) {
NavigationStack ns =
this.retrieveNavigationStack(req);
synchronized(ns) {
StackStep newStep = new
StackStep(dispatchName, mapping, form, isCheckPoint);
newStep.setServlet(this.getServlet());
//lo apila siempre y cuando sean
distintos (el último y el nuevo)
if(!newStep.equals(ns.getLast())) {
ns.push(newStep);
}
this.saveNavigationStack(req, ns);
}
}
}


I would like to know what you thing about this kind of navigation
management and know how are you dealing with this problem. With this
solution I can link 2 use case action (I designed one action for each
use case) and click back button to return wherever i was called.

Thanks in advance.

Guillermo Meyer
System Engineer.
EDS Argentina.


Problem with multibox check state

2003-12-24 Thread Rajesh, Harikrishnan (H.)
Hi,

I have a jsp input form with dynamically generated multibox, I need to fill these 
boxes with checked and unchecked state once the user selects a previously saved 
record. I need to know how to resolve this problem.

I have done the same with a single multibox, using the set('property name', value) in 
the action component. But for dynamically generated multibox what need to be done.

I have set the component name in the 'form bean' tag as 'java.lang.string'.

This is a very urgent requirement and might be a simple problem for you gurus.

Thanks for any help on this issue.

Regards
H.Rajesh



RE: Navigation Stack

2003-12-24 Thread shirishchandra.sakhare
Hi,
I found the idea interesting..

But I have a couple of questions...

the assumption you are making here is entire request parameters are captured in the 
form...How else can you call some action if it does not have access to all the request 
parameters..

Also it means that the action have very clean code and no forwarding of Objects as 
request attributes etc...


But if these  rules are followed,what you have done will definately work.


regards,
Shirish.

-Original Message-
From: Guillermo Meyer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 12:11 PM
To: Struts Users Mailing List
Subject: Navigation Stack


Hi:
I'm working with a Struts 1.0 application. I extended Action to create a
base action that handles backwards navigation in a stack fashion.
Each method calls a saveStep method to the stack. This step has form,
mapping and dispatch name. Base action has a method called stepBack
that can be called from the browser by clicking the back button (not
browser back button, but a submit button). This stepBack method executes
the last step in the stack and goes backwards. Another features exists
like checkPoint step, and an undoStep to return from a validation in
Validator Form.

public ActionForward stepBack(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws Exception {
NavigationStack ns =
this.retrieveNavigationStack(request);
synchronized(ns) {
//if not reloading
StackStep ss = null;
if(this.isTokenValid(request)) {
try {
  ns.pop(); //last step, ignore it.
ss = ns.pop();
} catch (Exception e){
   return this.handleEmptyStack(mapping, form, request,
response);
}
} else {
ss = ns.getLastPopped();
}
return ss.process(request, response);
}
}

public void saveStep(ActionMapping mapping, ActionForm form,
HttpServletRequest req, String dispatchName, boolean isCheckPoint) {
//si no se indicó invalidar el grabado...
if(this.isStepValid(req)) {
NavigationStack ns =
this.retrieveNavigationStack(req);
synchronized(ns) {
StackStep newStep = new
StackStep(dispatchName, mapping, form, isCheckPoint);
newStep.setServlet(this.getServlet());
//lo apila siempre y cuando sean
distintos (el último y el nuevo)
if(!newStep.equals(ns.getLast())) {
ns.push(newStep);
}
this.saveNavigationStack(req, ns);
}
}
}


I would like to know what you thing about this kind of navigation
management and know how are you dealing with this problem. With this
solution I can link 2 use case action (I designed one action for each
use case) and click back button to return wherever i was called.

Thanks in advance.

Guillermo Meyer
System Engineer.
EDS Argentina.

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



RE: Navigation Stack

2003-12-24 Thread Andrew Hill
Im working with struts1.1 myself.

Our application has quite a few screens that correspond to records in the
application, and these records are often related to other records in the
application - ie you might need to pick one from a drop down or such like.
We were able to give the user the ability to create (or edit) a record
related to the current screens record, and when finished come back to the
current screen (to select the newly created record) and keep working with
all fields entered so far preserved but without the record yet being saved.
This is allowed to any depth. (Our app can be quite complex to configure so
this also helps guide the user through all the records that need to be
configured for something (can be quite a few for something like configuring
the app to use a certain RosettaNet PIP with a certain partner or such like
stuff) - thus making it a sort of navigation stack ).

It works by using a stack of what I term Operation Context objects - in
that each element in the stack contains info related to the context of a
particular operation (ie : edit a type X record, etc...). The Operation
Contexts may be stacked, so if during editing a type X record the user
realises they need to create a type Y record for X to refer to they can go
off and do it, and when that operation is complete they will be brought back
to the screen for the X record...

Ive modified RequestProcessor so it will look for session scoped actionforms
in the operation context rather than the session if there is an operation
context associated with this request (managed by url rewriting to keep track
of the OpCons unique id). This has the added advantage of allowing me to
have several windows all working with the same record type (ie: same action
and type of action form) where the form is session scoped, without them
interfering with each other as would be the normal case with session scoped
action forms.

-Original Message-
From: Guillermo Meyer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 24 December 2003 19:11
To: Struts Users Mailing List
Subject: Navigation Stack


Hi:
I'm working with a Struts 1.0 application. I extended Action to create a
base action that handles backwards navigation in a stack fashion.
Each method calls a saveStep method to the stack. This step has form,
mapping and dispatch name. Base action has a method called stepBack
that can be called from the browser by clicking the back button (not
browser back button, but a submit button). This stepBack method executes
the last step in the stack and goes backwards. Another features exists
like checkPoint step, and an undoStep to return from a validation in
Validator Form.

public ActionForward stepBack(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws Exception {
NavigationStack ns =
this.retrieveNavigationStack(request);
synchronized(ns) {
//if not reloading
StackStep ss = null;
if(this.isTokenValid(request)) {
try {
  ns.pop(); //last step, ignore it.
ss = ns.pop();
} catch (Exception e){
   return this.handleEmptyStack(mapping, form, request,
response);
}
} else {
ss = ns.getLastPopped();
}
return ss.process(request, response);
}
}

public void saveStep(ActionMapping mapping, ActionForm form,
HttpServletRequest req, String dispatchName, boolean isCheckPoint) {
//si no se indicó invalidar el grabado...
if(this.isStepValid(req)) {
NavigationStack ns =
this.retrieveNavigationStack(req);
synchronized(ns) {
StackStep newStep = new
StackStep(dispatchName, mapping, form, isCheckPoint);
newStep.setServlet(this.getServlet());
//lo apila siempre y cuando sean
distintos (el último y el nuevo)
if(!newStep.equals(ns.getLast())) {
ns.push(newStep);
}
this.saveNavigationStack(req, ns);
}
}
}


I would like to know what you thing about this kind of navigation
management and know how are you dealing with this problem. With this
solution I can link 2 use case action (I designed one action for each
use case) and click back button to return wherever i was called.

Thanks in advance.

Guillermo Meyer
System Engineer.
EDS Argentina.


-
To 

Re: Problem with multibox check state

2003-12-24 Thread Mark Lowe
The checkboxes are selected depending on whether the value and the 
property value match..

html:multibox property=myprop value=foo /

if myprop is set to foo it will be ticked..



On 24 Dec 2003, at 11:11, Rajesh, Harikrishnan (H.) wrote:

Hi,

I have a jsp input form with dynamically generated multibox, I need to 
fill these boxes with checked and unchecked state once the user 
selects a previously saved record. I need to know how to resolve this 
problem.

I have done the same with a single multibox, using the set('property 
name', value) in the action component. But for dynamically generated 
multibox what need to be done.

I have set the component name in the 'form bean' tag as 
'java.lang.string'.

This is a very urgent requirement and might be a simple problem for 
you gurus.

Thanks for any help on this issue.

Regards
H.Rajesh


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


html:text value=? problem

2003-12-24 Thread Ciaran Hanley
I want to use an update user details page in my application which uses a
form to display the current user details and updates any changes. Im
having problems displaying the information of the user bean in the value
property.
 
What I want is 
html:text property=name value=current users name /
 
Ive tried the following which is giving me errors:
html:text property=name value=bean:write name=currentUser
property=name / /
 
Anybody know how to do this?
Thanks


Re: html:text value=? problem

2003-12-24 Thread Mark Lowe
html:text property=name value=%= user.getName() % /

or

html-el:text property=name value=${user.name} /

You can also  populate in the refering action (assuming you've one), i 
think this is better and keeps your form cleaner and thus perhaps more 
reusable.

theForm.setName(Brian);

or dynaactionform

theForm.set(name,Brian);

html:text property=name /

will render to

input type=text name=name value=Brian

Cheers Mark

On 24 Dec 2003, at 12:10, Ciaran Hanley wrote:

I want to use an update user details page in my application which uses 
a
form to display the current user details and updates any changes. Im
having problems displaying the information of the user bean in the 
value
property.

What I want is
html:text property=name value=current users name /
Ive tried the following which is giving me errors:
html:text property=name value=bean:write name=currentUser
property=name / /
Anybody know how to do this?
Thanks


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


any tool which can generate formbeans from jsp or html

2003-12-24 Thread Kalra, Ashwani
hi,
Is it possible to generate the formbeans from jsp or html. Is there any tool
available ?

Regds
Ashwani


This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst  Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



security of html pages max file size property

2003-12-24 Thread ludovic . maurillon

Hi all,

I have two questions:

1) I have a problem with the help menu of my application wich contains html
pages.
I would not like to access those pages without being log on, so I access
them via a secure Action that just do a forward to the good page:
action path=/help/helpAction
type=com.bnpparibas.primeweb.web.help.HelpAction
name=helpForm scope=request validate=false
forward name=menu path=/help/help.jsp/
forward name=banner path=/help/help_banner.jsp/
forward name=mainFrame path=/help/help_mainFrame.jsp/
forward name=home path=/help/help_home.htm/
forward name=index path=/help/help_index.jsp/
forward name=options path=/help/help_options.htm/
forward name=report path=/help/help_report.htm/
/action

But I still can access the pages without being log on, just by writing the
url in the browser.
I have so done a filter to disable the user to access this page, but I
would like to avoid this solution, I would prefier use Actions only. do you
have any idea.


2) File Upload: whe the clien exceed the max upload file size, I would like
to display a message via the message framework, which looks like this:
maxLengthExceeded= Maximum file size exceeded ({0})
where {0} is the max size setting in struts-config.xml. But I did not find where I can 
take programaticly this information


Thanks for your help.

So this is Christmas
And what have you done
Another year over
And a new one just begun






This message and any attachments (the message) is intended solely for the addressees 
and is confidential. 
If you receive this message in error, please delete it and immediately notify the 
sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole or partial, is prohibited 
except formal approval. 
The internet can not guarantee the integrity of this message. BNP PARIBAS (and its 
subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

-

Ce message et toutes les pieces jointes (ci-apres le message) sont etablis a 
l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de 
le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce message non conforme a sa 
destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. 
L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute 
responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


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



Re: PDF file in browser

2003-12-24 Thread hernux
You 're forgetting two things...

1- He wants to show a pdf  file in a new browser
to do that, you must set the apropiate target into de A tag...

a href=xxx.pdf target=_blankxxx/a

target=_blank will open the link in a new window.

2- This, will only work if the users uses Internet Explorer...cause it's an
activeX container, unless the
user changed it, by default pdf files and other documents, will be opened
inside explorer...but other
browsers such as netscape, mozilla and opera, are not activeX container, so,
pdf files will prompt the user
to download them, or open directly.

regards,
Hernux

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 7:17 AM
Subject: RE: PDF file in browser


Hi,
Also do not forget to set the header so that the save as dialogue box is
displayed in IE...For that you have to set the content-disposition header ..
following is the  code from our project..


Class  FileOpenAction{

protected final void returnBinaryFile(
HttpServletResponse response,
String filename
String saveAsName)
throws FileNotFoundException, IOException {
response.setContentType(mimeType);
String fileExt = WebUtil.getFileExtensionFromMIMEType(application/pdf);
setSaveAsHeader(response,saveAsName,fileExt);
File file = new File(filename);
response.setContentLength((int) file.length());

FileInputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] buf = new byte[4096];
int count = 0;

while ((count = in.read(buf)) = 0) {
out.write(buf, 0, count);
}

in.close();
out.close();
}

public static void setSaveAsHeader(HttpServletResponse response,String
saveAsFileName,String fileExt){
if(saveAsFileName == null){
return;
}
//to get over a problem in browsers due to which the file name must have
proper extension
if((fileExt != null)|| (fileExt.length() !=0)){
int index1 = saveAsFileName.indexOf(fileExt.toUpperCase());
int index2 = saveAsFileName.indexOf(fileExt.toLowerCase());
if((index1 == -1) (index2 == -1)){
saveAsFileName = saveAsFileName + . + fileExt;
}
}
response.addHeader(Content-Disposition, attachment; filename= +
saveAsFileName );
}
}

Also another thought..Why use another servlet..Just use another action like
we do..This way you can use all the existing framwroek..Like authorisation
etc

-Original Message-
From: Surachai Locharoen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 10:41 PM
To: Struts Users Mailing List
Subject: Re: PDF file in browser


Additionally, In struts framework you have to reset request header before by
call


request.reset();
request.setContentType(application/pdf);
request.setContentLength(byte.length);



- Original Message -
From: Navjot Singh [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:53 PM
Subject: RE: PDF file in browser


 if you can reveal the location of the PDFs on your web server.
 Simply put your pdfs under a www/app.com/pdfs/*.pdf and give them links as
 you want.

 if you wish to maintain some security.
 1. send a request to a servlet wit some pdf code or file name
 2. open the given file from the file system whereever it is.
 3. convert it into stream.
 4. push the stream back to browser.

 note - must set the appropraite mime/type before you push the stream back.
 may be application/pdf or application/x-pdf

 HTH
 Navjot Singh

 -Original Message-
 From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 10:50 AM
 To: 'Struts Users Mailing List'
 Subject: PDF file in browser
 
 
 
 
 Hi All,
 
  I am using Struts frame work for our application with Web sphere
 app server.
 We have a some PDF files on the app server .When the user clicks on a
 particular link on
 the JSP page, we have show a pdf  file to the user in a new browser
 window.
 Can any one pls tell me the easier procedure to do this??
 
 Regards
 VasudevRaoGupta
 
 
 Confidentiality Notice
 
 The information contained in this electronic message and any
 attachments to this message are intended
 for the exclusive use of the addressee(s) and may contain
 confidential or privileged information. If
 you are not the intended recipient, please notify the sender at
 Wipro or [EMAIL PROTECTED] immediately
 and destroy all copies of this message and any attachments.
 
 -
 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: 

RE: security of html pages max file size property

2003-12-24 Thread Mohan Radhakrishnan

This seem to be a authentication issue managed with Container Managed
Authentication

web-resource-collection
web-resource-nameweb/web-resource-name
descriptionRequire users to authenticate/description
url-pattern/xxx/*.jsp/url-pattern
http-methodPOST/http-method
http-methodGET/http-method
/web-resource-collection

CMA will popup your login page when a secure URL is accessed.

Mohan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 6:58 PM
To: [EMAIL PROTECTED]
Subject: security of html pages  max file size property



Hi all,

I have two questions:

1) I have a problem with the help menu of my application wich contains html
pages.
I would not like to access those pages without being log on, so I access
them via a secure Action that just do a forward to the good page:
action path=/help/helpAction
type=com.bnpparibas.primeweb.web.help.HelpAction
name=helpForm scope=request validate=false
forward name=menu path=/help/help.jsp/
forward name=banner path=/help/help_banner.jsp/
forward name=mainFrame path=/help/help_mainFrame.jsp/
forward name=home path=/help/help_home.htm/
forward name=index path=/help/help_index.jsp/
forward name=options path=/help/help_options.htm/
forward name=report path=/help/help_report.htm/
/action

But I still can access the pages without being log on, just by writing the
url in the browser.
I have so done a filter to disable the user to access this page, but I
would like to avoid this solution, I would prefier use Actions only. do you
have any idea.


2) File Upload: whe the clien exceed the max upload file size, I would like
to display a message via the message framework, which looks like this:
maxLengthExceeded= Maximum file size exceeded ({0})
where {0} is the max size setting in struts-config.xml. But I did not find
where I can take programaticly this information


Thanks for your help.

So this is Christmas
And what have you done
Another year over
And a new one just begun






This message and any attachments (the message) is intended solely for the
addressees and is confidential.
If you receive this message in error, please delete it and immediately
notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole or partial, is
prohibited except formal approval.
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

-

Ce message et toutes les pieces jointes (ci-apres le message) sont etablis
a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce message par erreur,
merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce message non conforme a
sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf autorisation
expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales)
decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.


-
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: retrieving values from application.properties file

2003-12-24 Thread Mohan Radhakrishnan

This might be the wrapper you are looking for

protected MessageResources getMessageResources(){
return MessageResources.getMessageResources(ApplicationResources);
}

//getMessageResources().getMessage( key );

The API has lot of other methods.


Mohan
-Original Message-
From: Kalra, Ashwani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 4:03 PM
To: Struts Users Mailing List
Subject: RE: retrieving values from application.properties file


Ok, Thanks. I thought that I could use some struts wrapper class which will
provide some fn which takes the key as input. I didnt wanted to load  the
bundle etc as its already done by struts.
Any way thanks.


-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 1:01 PM
To: Struts Users Mailing List
Subject: RE: retrieving values from application.properties file


Use

ResourceBundle resource =
ResourceBundle.getBundle(resources.application);

Else :
If you are in Action/Lookup Dispatch Action class

MessageResources resource = getResources(request);





-Original Message-
From: Kalra, Ashwani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 2:24 AM
To: Struts Users Mailing List
Subject: RE: retrieving values from application.properties file

hi,
One more thing to add is that I dont have access to request,pagecontext
etc.
I am writing a Servicelocator class and I want to access some values in
that file. Is it possible.
Otherwise I have to use my own resource bundle.





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:48 PM
To: [EMAIL PROTECTED]
Subject: RE: retrieving values from application.properties file


Hi Ashwani

In a jsp page use follwing code:


org.apache.struts.util.PropertyMessageResources res =

(org.apache.struts.util.PropertyMessageResources)application.ge
tAttribut
e(org.apache.struts.Globals.MESSAGES_KEY);
  out.println(res.getMessage(KEYNAME));


Dhiraj

-Original Message-
From: Kalra, Ashwani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:27 PM
To: Struts (E-mail)
Subject: retrieving values from application.properties file

hi,
I want to directly access the keys and its values in
applcation.properties ( default resource bundle file in struts). Can
any body tell me which is the class in struts(utility class) which
helps me retrieve the values based on the keys from this file.

/Ashwani


This message contains information that may be privileged or
confidential and is the property of the Cap Gemini Ernst 
Young Group.

It is intended only for the person to whom it is addressed.
If you are
not the intended recipient, you are not authorised to read, print,
retain, copy, disseminate, distribute, or use this message or
any part
thereof. If you receive this message in error, please notify
the sender

immediately and delete all copies of this message.

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



DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended
recipient you should not disseminate,distribute,store,print, copy or
deliver this message.Please notify the sender immediately by
e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system.E-mail transmission cannot be guaranteed to be secure or
error-free as information could be
intercepted,corrupted,lost,destroyed,arrive late or incomplete or
contain viruses.The sender therefore does not accept
liability for any
errors or omissions in the contents of this message which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version.

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



This message contains information that may be privileged or
confidential
and is the property of the Cap Gemini Ernst  Young Group. It is
intended only for the person to whom it is addressed. If you
are not the
intended recipient, you are not authorised to read, print,
retain, copy,
disseminate, distribute, or use this message or any part
thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message.

-
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: PDF file in browser

2003-12-24 Thread Martin Gainty
If Struts is J2EE on Steroids
Then FOP is PDF on Steroids
check out Implementing Formatting Objects Processor at
http://xml.apache.org/fop/

Saludos,
-Martin
- Original Message - 
From: hernux [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 8:33 AM
Subject: Re: PDF file in browser


 You 're forgetting two things...

 1- He wants to show a pdf  file in a new browser
 to do that, you must set the apropiate target into de A tag...

 a href=xxx.pdf target=_blankxxx/a

 target=_blank will open the link in a new window.

 2- This, will only work if the users uses Internet Explorer...cause it's
an
 activeX container, unless the
 user changed it, by default pdf files and other documents, will be opened
 inside explorer...but other
 browsers such as netscape, mozilla and opera, are not activeX container,
so,
 pdf files will prompt the user
 to download them, or open directly.

 regards,
 Hernux

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 7:17 AM
 Subject: RE: PDF file in browser


 Hi,
 Also do not forget to set the header so that the save as dialogue box is
 displayed in IE...For that you have to set the content-disposition header
.
 following is the  code from our project..


 Class  FileOpenAction{

 protected final void returnBinaryFile(
 HttpServletResponse response,
 String filename
 String saveAsName)
 throws FileNotFoundException, IOException {
 response.setContentType(mimeType);
 String fileExt = WebUtil.getFileExtensionFromMIMEType(application/pdf);
 setSaveAsHeader(response,saveAsName,fileExt);
 File file = new File(filename);
 response.setContentLength((int) file.length());

 FileInputStream in = new FileInputStream(file);
 OutputStream out = response.getOutputStream();
 byte[] buf = new byte[4096];
 int count = 0;

 while ((count = in.read(buf)) = 0) {
 out.write(buf, 0, count);
 }

 in.close();
 out.close();
 }

 public static void setSaveAsHeader(HttpServletResponse response,String
 saveAsFileName,String fileExt){
 if(saveAsFileName == null){
 return;
 }
 //to get over a problem in browsers due to which the file name must have
 proper extension
 if((fileExt != null)|| (fileExt.length() !=0)){
 int index1 = saveAsFileName.indexOf(fileExt.toUpperCase());
 int index2 = saveAsFileName.indexOf(fileExt.toLowerCase());
 if((index1 == -1) (index2 == -1)){
 saveAsFileName = saveAsFileName + . + fileExt;
 }
 }
 response.addHeader(Content-Disposition, attachment; filename= +
 saveAsFileName );
 }
 }

 Also another thought..Why use another servlet..Just use another action
like
 we do..This way you can use all the existing framwroek..Like authorisation
 etc

 -Original Message-
 From: Surachai Locharoen [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 10:41 PM
 To: Struts Users Mailing List
 Subject: Re: PDF file in browser


 Additionally, In struts framework you have to reset request header before
by
 call


 request.reset();
 request.setContentType(application/pdf);
 request.setContentLength(byte.length);



 - Original Message -
 From: Navjot Singh [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, December 23, 2003 9:53 PM
 Subject: RE: PDF file in browser


  if you can reveal the location of the PDFs on your web server.
  Simply put your pdfs under a www/app.com/pdfs/*.pdf and give them links
as
  you want.
 
  if you wish to maintain some security.
  1. send a request to a servlet wit some pdf code or file name
  2. open the given file from the file system whereever it is.
  3. convert it into stream.
  4. push the stream back to browser.
 
  note - must set the appropraite mime/type before you push the stream
back.
  may be application/pdf or application/x-pdf
 
  HTH
  Navjot Singh
 
  -Original Message-
  From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 24, 2003 10:50 AM
  To: 'Struts Users Mailing List'
  Subject: PDF file in browser
  
  
  
  
  Hi All,
  
   I am using Struts frame work for our application with Web sphere
  app server.
  We have a some PDF files on the app server .When the user clicks on a
  particular link on
  the JSP page, we have show a pdf  file to the user in a new browser
  window.
  Can any one pls tell me the easier procedure to do this??
  
  Regards
  VasudevRaoGupta
  
  
  Confidentiality Notice
  
  The information contained in this electronic message and any
  attachments to this message are intended
  for the exclusive use of the addressee(s) and may contain
  confidential or privileged information. If
  you are not the intended recipient, please notify the sender at
  Wipro or [EMAIL PROTECTED] immediately
  and destroy all copies of this message and any attachments.
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For 

Select without selected value

2003-12-24 Thread AKostylev
I want to have select element without any selected values by default.
I can do this by setting selectedIndex=-1 or
value='not_existing_value' in JavaScript.
Can I do this with Struts functionality?


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



[OT] Synchronized access to application-scoped object

2003-12-24 Thread Jerry Jalenak
Holiday Greetings to All!

Quick design question - Is it possible to synchronize an application-scoped
object between two servlets within the same web application?  I have a
servlet that I have written that maintains a List object that is stored in
application scope.  This servlet basically creates a new List, then replaces
the existing one (uses the same name for the object).  My second servlet
(Struts) simply accesses this List in a read-only fashion - no updates.  I
can write a basic spin-lock type of mechanism to ensure that my Actions do
not try to access this List while my first servlet is replacing the object,
but I'm wondering if there is an easier approach, possibly using a
synchronized block using the application object

Comments?

TIA!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


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


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



RE: any tool which can generate formbeans from jsp or html

2003-12-24 Thread vasudevrao gupta

HI,

WSAD(Websphere studio development) has a facility to generate actionform
beans from JSP

Regards
Vasudevraogupta
-Original Message-
From: Kalra, Ashwani [mailto:[EMAIL PROTECTED] 
Sent: 24 December 2003 18:40
To: Struts (E-mail)
Subject: any tool which can generate formbeans from jsp or html


hi,
Is it possible to generate the formbeans from jsp or html. Is there any
tool
available ?

Regds
Ashwani


This message contains information that may be privileged or confidential
and
is the property of the Cap Gemini Ernst  Young Group. It is intended
only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies
of this message.

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


Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Select without selected value

2003-12-24 Thread Mark Lowe
Just don't set the form value.

On 24 Dec 2003, at 15:15, AKostylev wrote:

I want to have select element without any selected values by default.
I can do this by setting selectedIndex=-1 or
value='not_existing_value' in JavaScript.
Can I do this with Struts functionality?
-
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]


parameters in a link

2003-12-24 Thread Otávio Augusto
Hi all

I'm trying to add a parameter (yeah,i mean only one) to a link. actually, it is an 
logic:iterator tag which generates a table, and one of the columns is the link to an 
action which is going to get the parameter send throw the request, process it and go 
to a jsp. so, the code follows:

logic:iterate id=setor name=setores
  tr
tdbean:write name=setor property=nome //td
tdbean:write name=setor property=comentario //td
bean:define id=idSetor name=setor property=id /
tdhtml:link action=setoradmin paramProperty=idSetor 
paramName=setorDetalhes/html:link/td
  /tr
/logic:iterate

I correctly generate de table and its values, but i can't generate the parameter i 
need to add to the link. Of course, this code might be wrong.
Any sugestions?

thanks, and happy holydays.

Otávio augusto

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



Re: parameters in a link

2003-12-24 Thread Mark Lowe
just need paramId to set the parameter name.

On 24 Dec 2003, at 15:59, Otávio Augusto wrote:

Hi all

I'm trying to add a parameter (yeah,i mean only one) to a link. 
actually, it is an logic:iterator tag which generates a table, and one 
of the columns is the link to an action which is going to get the 
parameter send throw the request, process it and go to a jsp. so, the 
code follows:

logic:iterate id=setor name=setores
  tr
tdbean:write name=setor property=nome //td
tdbean:write name=setor property=comentario //td
	bean:define id=idSetor name=setor property=id /
	tdhtml:link action=setoradmin paramProperty=idSetor 
paramName=setorDetalhes/html:link/td
  /tr
/logic:iterate

I correctly generate de table and its values, but i can't generate the 
parameter i need to add to the link. Of course, this code might be 
wrong.
Any sugestions?

thanks, and happy holydays.

Otávio augusto

-
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: parameters in a link

2003-12-24 Thread Otávio Augusto
U mean i just need to add the paramId ?

thanks 
Otávio Augusto

On Wed, 24 Dec 2003 16:11:52 +
Mark Lowe [EMAIL PROTECTED] wrote:

 just need paramId to set the parameter name.
 
 
 On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
 
  Hi all
 
  I'm trying to add a parameter (yeah,i mean only one) to a link. 
  actually, it is an logic:iterator tag which generates a table, and one 
  of the columns is the link to an action which is going to get the 
  parameter send throw the request, process it and go to a jsp. so, the 
  code follows:
 
  logic:iterate id=setor name=setores
tr
  tdbean:write name=setor property=nome //td
  tdbean:write name=setor property=comentario //td
  bean:define id=idSetor name=setor property=id /
  tdhtml:link action=setoradmin paramProperty=idSetor 
  paramName=setorDetalhes/html:link/td
/tr
  /logic:iterate
 
  I correctly generate de table and its values, but i can't generate the 
  parameter i need to add to the link. Of course, this code might be 
  wrong.
  Any sugestions?
 
  thanks, and happy holydays.
 
  Otávio augusto
 
  -
  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[2]: Select without selected value

2003-12-24 Thread AKostylev
Wednesday, December 24, 2003, 7:02:24 PM, you wrote:

ML Just don't set the form value.


ML On 24 Dec 2003, at 15:15, AKostylev wrote:

 I want to have select element without any selected values by default.
 I can do this by setting selectedIndex=-1 or
 value='not_existing_value' in JavaScript.
 Can I do this with Struts functionality?

I use select with multiple=false and I don't set the parameter's
value. As result I get:

form name=faqForm method=post action=/dp/showFaq.do
select name=id onchange=submit()
option value=1Test1/option
option value=2Test2/option
/select
/form

So none of options has selected attribute, but first option is
selected on the page.


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



Re: parameters in a link

2003-12-24 Thread Brice Ruth
the paramId value of html:link will be the name of the parameter that 
gets passed in the query string, the paramName attribute will be the 
name of a bean that is used (toString) to generate the value of that 
parameter. So, something like this:

c:set var=myTopic value=Struts/
html:link action=/myAction paramId=topic paramName=myTopicmy 
link/html:link

Should generate a link like so:

a href=/myAction.do?topic=Strutsmy link/a

Make sense?

Otávio Augusto wrote:

U mean i just need to add the paramId ?

thanks 
Otávio Augusto

On Wed, 24 Dec 2003 16:11:52 +
Mark Lowe [EMAIL PROTECTED] wrote:
 

just need paramId to set the parameter name.

On 24 Dec 2003, at 15:59, Otávio Augusto wrote:

   

Hi all

I'm trying to add a parameter (yeah,i mean only one) to a link. 
actually, it is an logic:iterator tag which generates a table, and one 
of the columns is the link to an action which is going to get the 
parameter send throw the request, process it and go to a jsp. so, the 
code follows:

logic:iterate id=setor name=setores
 tr
   tdbean:write name=setor property=nome //td
   tdbean:write name=setor property=comentario //td
	bean:define id=idSetor name=setor property=id /
	tdhtml:link action=setoradmin paramProperty=idSetor 
paramName=setorDetalhes/html:link/td
 /tr
/logic:iterate

I correctly generate de table and its values, but i can't generate the 
parameter i need to add to the link. Of course, this code might be 
wrong.
Any sugestions?

thanks, and happy holydays.

Otávio augusto

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: parameters in a link

2003-12-24 Thread Brice Ruth
Oh, and check here:

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

All the info you should ever need :)

Otávio Augusto wrote:

U mean i just need to add the paramId ?

thanks 
Otávio Augusto

On Wed, 24 Dec 2003 16:11:52 +
Mark Lowe [EMAIL PROTECTED] wrote:
 

just need paramId to set the parameter name.

On 24 Dec 2003, at 15:59, Otávio Augusto wrote:

   

Hi all

I'm trying to add a parameter (yeah,i mean only one) to a link. 
actually, it is an logic:iterator tag which generates a table, and one 
of the columns is the link to an action which is going to get the 
parameter send throw the request, process it and go to a jsp. so, the 
code follows:

logic:iterate id=setor name=setores
 tr
   tdbean:write name=setor property=nome //td
   tdbean:write name=setor property=comentario //td
	bean:define id=idSetor name=setor property=id /
	tdhtml:link action=setoradmin paramProperty=idSetor 
paramName=setorDetalhes/html:link/td
 /tr
/logic:iterate

I correctly generate de table and its values, but i can't generate the 
parameter i need to add to the link. Of course, this code might be 
wrong.
Any sugestions?

thanks, and happy holydays.

Otávio augusto

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: parameters in a link

2003-12-24 Thread Otávio Augusto
Thanks Brice. Works fine now, and it makes all sense.

Otávio Augusto

On Wed, 24 Dec 2003 10:27:46 -0600
Brice Ruth [EMAIL PROTECTED] wrote:

 the paramId value of html:link will be the name of the parameter that 
 gets passed in the query string, the paramName attribute will be the 
 name of a bean that is used (toString) to generate the value of that 
 parameter. So, something like this:
 
 c:set var=myTopic value=Struts/
 html:link action=/myAction paramId=topic paramName=myTopicmy 
 link/html:link
 
 Should generate a link like so:
 
 a href=/myAction.do?topic=Strutsmy link/a
 
 Make sense?
 
 Otávio Augusto wrote:
 
 U mean i just need to add the paramId ?
 
 thanks 
 Otávio Augusto
 
 On Wed, 24 Dec 2003 16:11:52 +
 Mark Lowe [EMAIL PROTECTED] wrote:
 
   
 
 just need paramId to set the parameter name.
 
 
 On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
 
 
 
 Hi all
 
 I'm trying to add a parameter (yeah,i mean only one) to a link. 
 actually, it is an logic:iterator tag which generates a table, and one 
 of the columns is the link to an action which is going to get the 
 parameter send throw the request, process it and go to a jsp. so, the 
 code follows:
 
 logic:iterate id=setor name=setores
   tr
 tdbean:write name=setor property=nome //td
 tdbean:write name=setor property=comentario //td
bean:define id=idSetor name=setor property=id /
tdhtml:link action=setoradmin paramProperty=idSetor 
 paramName=setorDetalhes/html:link/td
   /tr
 /logic:iterate
 
 I correctly generate de table and its values, but i can't generate the 
 parameter i need to add to the link. Of course, this code might be 
 wrong.
 Any sugestions?
 
 thanks, and happy holydays.
 
 Otávio augusto
 
 -
 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]
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 -
 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]



logic:iterate problem (not loading complete jsp)

2003-12-24 Thread shahfazal
Hi all-
I have a problem which i'm sure someone else must have gone thru. I have a 
collection of Value Objects that hve properties like firstName, lastName 
etc. I wrote a getter in the form bean that returns this collection of 
value objects
[code]
// This is my IncompleteFolderAction.java
.
while(rs.next())
{
application = new ApplicationVO();
application.setFirstName(rs.getString(FIRST_NAME));
application.setLastName(rs.getString(LAST_NAME));
...
}

// This is my IncompleteFolderForm.java (form bean)
...
public Collection getApplications()
{
return applications;
}
...
[/code]
the following is the code i wrote on the jsp to access this collection and 
iterate thru the value objects

logic:iterate id=appList name=incompleteFolderForm 
property=applications
tr
tdbean:write name=appList property=firstName//td
tdbean:write name=appList property=lastName//td
..
/tr
/logic:iterate

 and my struts-config.xml contains an action name=incompleteFolderForm 
that maps to the form-bean IncompleteFolderForm

My problem is i dont see anythign on the jsp once it returns ..it's all 
blank .. but the getter methods are being accessed coz i printed a string 
from the getApplications() and it did print. when i tried to view the 
source of the jsp .. it shows only half (or less, i dont know) of the 
source code ..it's as if the page stopped loading .. i've been working on 
it since like 2 days now.. and it'd be really great if anyone could help me 
or point me to some place where i can get some info

I'm using Apache Tomcat 5.0 with Struts 1.1 ...

Thankx a lot :)

Regards..

Shahfazal Mohammed
Research A$$i$tant
Center for Business and Information Technologies
http://www.cbit.louisiana.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Re[2]: Select without selected value

2003-12-24 Thread Wendy Smoak
 -Original Message-
 I use select with multiple=false and I don't set the parameter's
 value. As result I get:
 form name=faqForm method=post action=/dp/showFaq.do
 select name=id onchange=submit()
 option value=1Test1/option
 option value=2Test2/option
 /select
 /form
 So none of options has selected attribute, but first option is
 selected on the page.

I think what you're trying to do is invalid HTML, and the browser is
fixing it for you by selecting the first element.  In a drop-down
select list, there's really no such thing as having none of the items
selected.  Whichever one is visible is selected.  

If you need to have 'nothing' selected, how about a 'blank' element at
the top:
  option value=--Please choose one--/option

You may not be setting the value, but the form property exists, so it
DOES have a value-- null or the empty string, probably.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: Select without selected value

2003-12-24 Thread Brice Ruth
You could also do something like:

option/option

Which should give you something resembling no option being selected. 
Beware, unless you have validation of this field, it is perfectly valid 
for the browser to submit this ...

Wendy Smoak wrote:

-Original Message-
I use select with multiple=false and I don't set the parameter's
value. As result I get:
form name=faqForm method=post action=/dp/showFaq.do
   select name=id onchange=submit()
   option value=1Test1/option
   option value=2Test2/option
   /select
/form
So none of options has selected attribute, but first option is
selected on the page.
   

I think what you're trying to do is invalid HTML, and the browser is
fixing it for you by selecting the first element.  In a drop-down
select list, there's really no such thing as having none of the items
selected.  Whichever one is visible is selected.  

If you need to have 'nothing' selected, how about a 'blank' element at
the top:
 option value=--Please choose one--/option
You may not be setting the value, but the form property exists, so it
DOES have a value-- null or the empty string, probably.
 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Select without selected value

2003-12-24 Thread Mark Lowe
an option will only be selected by default if the form property has 
been set to a value or there is a match in an available scope (like a 
parameter with the same name as the form property). Otherwise it will 
just do its thing.

I'd use a simple action without a formbean for something like a 
navigation menu

form action=c:url value=/process.do / method=POST
	select name=id ...
	
String id = request.getParameter(id).toString();
get the values out of the parameter map as you would with a plain old 
servlet.

but nothing wrong with using an action form, especially for consistency.

Cheers Mark

On 24 Dec 2003, at 17:08, Brice Ruth wrote:

You could also do something like:

option/option

Which should give you something resembling no option being selected. 
Beware, unless you have validation of this field, it is perfectly 
valid for the browser to submit this ...

Wendy Smoak wrote:

-Original Message-
I use select with multiple=false and I don't set the parameter's
value. As result I get:
form name=faqForm method=post action=/dp/showFaq.do
   select name=id onchange=submit()
   option value=1Test1/option
   option value=2Test2/option
   /select
/form
So none of options has selected attribute, but first option is
selected on the page.
I think what you're trying to do is invalid HTML, and the browser is
fixing it for you by selecting the first element.  In a drop-down
select list, there's really no such thing as having none of the items
selected.  Whichever one is visible is selected.
If you need to have 'nothing' selected, how about a 'blank' element at
the top:
 option value=--Please choose one--/option
You may not be setting the value, but the form property exists, so it
DOES have a value-- null or the empty string, probably.

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
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]


Easy question: iterate

2003-12-24 Thread e-denton Java Programmer
Sorry to bother you with an easy question, but I can't find the answer.

I want to iterate over Category_VO[] which is stored in a session attribute.
I read that it can be done, but I can't find an example for raw arrays.

Here's what I have (which probably doesn't even make sense):

logic:iterate
 id=category
 collection=com.cnw.portal.database.Category_VO
 type=com.cnw.portal.database.Category_VO
 scope=session
p bean:write name=category property=shortTitle/
/logic:iterate


Thanks!

will


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



RE: Easy question: iterate

2003-12-24 Thread Nguyen, Hien
I think life would be easier if you store your Category_VO objects in a
java.util.Collection, then use JSTL forEach tag.  Something like this:

%
Collection v = new Vector();
  v.add( new Category_VO(cat 1) ); //Assuming your constructor takes a
String which is the shortTitle
  v.add( new Category_VO(cat 2) );
  v.add( new Category_VO(cat 3) );
  v.add( new Category_VO(cat 4) );

request.putAttribute(categories,v);
%


c:forEach items=${categories} var=cat
c:out write=${cat.shortTitle}/
/c:forEach

--Hien

-Original Message-
From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 24, 2003 1:24 PM
To: Struts Users Mailing List
Subject: Easy question: iterate


Sorry to bother you with an easy question, but I can't find the answer.

I want to iterate over Category_VO[] which is stored in a session attribute.
I read that it can be done, but I can't find an example for raw arrays.

Here's what I have (which probably doesn't even make sense):

logic:iterate
 id=category
 collection=com.cnw.portal.database.Category_VO
 type=com.cnw.portal.database.Category_VO
 scope=session
p bean:write name=category property=shortTitle/ /logic:iterate


Thanks!

will


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



From Suresh

2003-12-24 Thread Suresh Korvi


  Hi Guys

   Can anybody help how to work with StrutsTestCase i am using Eclipse

  suresh

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



Re: Easy question: iterate

2003-12-24 Thread Mark Lowe
//psuedo code.
List categoryList = Category.getList();
request.setAttribute(categories, categoryList.toArray());

logic:iterate id=category name=categories

/logic:iterate
I made the first bit up. But should give you the idea.

jsp:useBean id=categories 
class=com.cnw.portal.database.Category_VO scope=request /

may do what you want.. Depends on what methods you've got in there..

Cheers Mark

On 24 Dec 2003, at 18:23, e-denton Java Programmer wrote:

Sorry to bother you with an easy question, but I can't find the answer.

I want to iterate over Category_VO[] which is stored in a session 
attribute.
I read that it can be done, but I can't find an example for raw arrays.

Here's what I have (which probably doesn't even make sense):

logic:iterate
 id=category
 collection=com.cnw.portal.database.Category_VO
 type=com.cnw.portal.database.Category_VO
 scope=session
p bean:write name=category property=shortTitle/
/logic:iterate
Thanks!

will

-
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: From Suresh

2003-12-24 Thread Ramadoss Chinnakuzhandai
Just look at the existing mail archives which has similar thread

-Original Message-
From: Suresh Korvi 
Sent: Wednesday, December 24, 2003 1:32 PM
To: [EMAIL PROTECTED]
Subject: From Suresh




  Hi Guys

   Can anybody help how to work with StrutsTestCase i am using Eclipse

  suresh

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


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



RE: html:text value=? problem

2003-12-24 Thread Daniel Lipofsky
If I am understanding correctly you just want
html:text property=name/
which will pull the value from the name property of the bean.
If you specify a value in the tag it oiverrides what is in
the bean.
- Dan

 I want to use an update user details page in my application 
 which uses a
 form to display the current user details and updates any changes. Im
 having problems displaying the information of the user bean 
 in the value
 property.
  
 What I want is 
 html:text property=name value=current users name /
  
 Ive tried the following which is giving me errors:
 html:text property=name value=bean:write name=currentUser
 property=name / /

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



Re: From Suresh

2003-12-24 Thread Martin Gainty
Suresh
Post to StrutsTestCase Forum
http://sourceforge.net/forum/forum.php?forum_id=121751
Keep me apprised,
-Martin
- Original Message - 
From: Ramadoss Chinnakuzhandai [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 1:33 PM
Subject: RE: From Suresh


Just look at the existing mail archives which has similar thread

-Original Message-
From: Suresh Korvi 
Sent: Wednesday, December 24, 2003 1:32 PM
To: [EMAIL PROTECTED]
Subject: From Suresh




  Hi Guys

   Can anybody help how to work with StrutsTestCase i am using Eclipse

  suresh

-
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: Select without selected value

2003-12-24 Thread Daniel Lipofsky
Or you can override the form value like this
html:select ... value=x
If the value you set doesn't exist then nothing will
be selected.  Which means the first item will be
selected, because something always is (if we are talking
about a dropdown and not a multiselect).  But you can
always add a blank first item like this
html:option value= /

- Dan

 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 8:02 AM
 To: Struts Users Mailing List
 Subject: Re: Select without selected value
 
 
 Just don't set the form value.
 
 
 On 24 Dec 2003, at 15:15, AKostylev wrote:
 
  I want to have select element without any selected values 
 by default.
  I can do this by setting selectedIndex=-1 or
  value='not_existing_value' in JavaScript.
  Can I do this with Struts functionality?
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: [OT] Synchronized access to application-scoped object

2003-12-24 Thread Craig R. McClanahan
Quoting Jerry Jalenak [EMAIL PROTECTED]:

 Holiday Greetings to All!
 
 Quick design question - Is it possible to synchronize an application-scoped
 object between two servlets within the same web application?  I have a
 servlet that I have written that maintains a List object that is stored in
 application scope.  This servlet basically creates a new List, then replaces
 the existing one (uses the same name for the object).  My second servlet
 (Struts) simply accesses this List in a read-only fashion - no updates.  I
 can write a basic spin-lock type of mechanism to ensure that my Actions do
 not try to access this List while my first servlet is replacing the object,
 but I'm wondering if there is an easier approach, possibly using a
 synchronized block using the application object
 
 Comments?
 

Synchronizing on the List instance won't help much, because of the way you're
replacing the old one with a new one -- but it's probably unnecessary as well,
since the servlet reading the old List and the servlet creating the new List
are never manipulating the same object instance.

If the servlet doing the modifying was doing it in place on the existing List
instance, then synchronizing on that instance would indeed be appropriate.

 TIA!
 
 Jerry Jalenak

Craig


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



RE: Easy question: iterate

2003-12-24 Thread Daniel Lipofsky
%
LabelValueBean[] lvArray = new LabelValueBean[] {
new LabelValueBean(label1, value1),
new LabelValueBean(label2, value2),
new LabelValueBean(label3, value3),
new LabelValueBean(label4, value4) };
request.setAttribute(lvArray, lvArray);
%
logic:iterate name=lvArray id=row indexId=rowIndex
 type=org.apache.struts.util.LabelValueBean
bean:write name=rowIndex/ -
bean:write name=row property=label/ -
bean:write name=row property=value/BR
/logic:iterate

 -Original Message-
 From: e-denton Java Programmer [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 10:24 AM
 To: Struts Users Mailing List
 Subject: Easy question: iterate
 
 
 Sorry to bother you with an easy question, but I can't find 
 the answer.
 
 I want to iterate over Category_VO[] which is stored in a 
 session attribute.
 I read that it can be done, but I can't find an example for 
 raw arrays.
 
 Here's what I have (which probably doesn't even make sense):
 
 logic:iterate
  id=category
  collection=com.cnw.portal.database.Category_VO
  type=com.cnw.portal.database.Category_VO
  scope=session
 p bean:write name=category property=shortTitle/
 /logic:iterate
 
 
 Thanks!
 
 will

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



Re: Easy question: iterate

2003-12-24 Thread e-denton Java Programmer
Hi Mark,

I tried this:

Category_VO[] pcatResults = null;
Category_DAO dao= new Category_DAO();
pcatResults = dao.selectTopLevel();
request.getSession (true).setAttribute (PCAT, pcatResults);
---
 jsp:useBean id=PCAT class=com.cnw.portal.database.Category_VO
scope=session /

 logic:iterate id=category name=PCAT
 pbean:write name=category property=shortTitle/
 /logic:iterate

and, I get this:

javax.servlet.jsp.JspException: Cannot create iterator for this
collection


Will

- Original Message - 
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 12:31 PM
Subject: Re: Easy question: iterate



 //psuedo code.
 List categoryList = Category.getList();

 request.setAttribute(categories, categoryList.toArray());

 logic:iterate id=category name=categories

 /logic:iterate

 I made the first bit up. But should give you the idea.

 jsp:useBean id=categories
 class=com.cnw.portal.database.Category_VO scope=request /

 may do what you want.. Depends on what methods you've got in there..

 Cheers Mark


 On 24 Dec 2003, at 18:23, e-denton Java Programmer wrote:

  Sorry to bother you with an easy question, but I can't find the answer.
 
  I want to iterate over Category_VO[] which is stored in a session
  attribute.
  I read that it can be done, but I can't find an example for raw arrays.
 
  Here's what I have (which probably doesn't even make sense):
 
  logic:iterate
   id=category
   collection=com.cnw.portal.database.Category_VO
   type=com.cnw.portal.database.Category_VO
   scope=session
  p bean:write name=category property=shortTitle/
  /logic:iterate
 
 
  Thanks!
 
  will
 
 
  -
  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: Easy question: iterate

2003-12-24 Thread Mark Lowe
Looks like you should copy what your view needs from your model rather 
than shoe-horning in your data objects into your jsps.

Have a simple bean called Category in this example with a title 
property.

Category_VO[] pcatResults = dao.selectTopLevel();

ArrayList categoryList = new ArrayList();

while(pcatResults.next()) {
Category category = new Category();
String title = pcatResults.getShortTitle();
category.setTitle(title);
categoryList.add(category);
}
request.setAttribute(categories, categoryList.toArray());

Any good?

Wont need the useBean stuff, i just didn't know what you were trying.

Cheers Mark

On 24 Dec 2003, at 19:20, e-denton Java Programmer wrote:

Hi Mark,

I tried this:

Category_VO[] pcatResults = null;
Category_DAO dao= new Category_DAO();
pcatResults = dao.selectTopLevel();
request.getSession (true).setAttribute (PCAT, pcatResults);
---
 jsp:useBean id=PCAT class=com.cnw.portal.database.Category_VO
scope=session /
 logic:iterate id=category name=PCAT
 pbean:write name=category property=shortTitle/
 /logic:iterate
and, I get this:

javax.servlet.jsp.JspException: Cannot create iterator for this
collection
Will

- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 12:31 PM
Subject: Re: Easy question: iterate

//psuedo code.
List categoryList = Category.getList();
request.setAttribute(categories, categoryList.toArray());

logic:iterate id=category name=categories

/logic:iterate

I made the first bit up. But should give you the idea.

jsp:useBean id=categories
class=com.cnw.portal.database.Category_VO scope=request /
may do what you want.. Depends on what methods you've got in there..

Cheers Mark

On 24 Dec 2003, at 18:23, e-denton Java Programmer wrote:

Sorry to bother you with an easy question, but I can't find the 
answer.

I want to iterate over Category_VO[] which is stored in a session
attribute.
I read that it can be done, but I can't find an example for raw 
arrays.

Here's what I have (which probably doesn't even make sense):

logic:iterate
 id=category
 collection=com.cnw.portal.database.Category_VO
 type=com.cnw.portal.database.Category_VO
 scope=session
p bean:write name=category property=shortTitle/
/logic:iterate
Thanks!

will

-
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: [OT] Synchronized access to application-scoped object

2003-12-24 Thread Jerry Jalenak
Craig - 

Thanks for the response.  One last question - during the time period where
the getServletContext().setAttribute() is executing in Servlet_1, is there
any concern about collision with an access from Servlet_2 (Struts)?  I guess
I'm unsure whether the setAttribute() method is synchronized or not
(the javadoc doesn't say.)

Thanks!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 1:00 PM
 To: Struts Users Mailing List
 Subject: Re: [OT] Synchronized access to application-scoped object
 
 
 Quoting Jerry Jalenak [EMAIL PROTECTED]:
 
  Holiday Greetings to All!
  
  Quick design question - Is it possible to synchronize an 
 application-scoped
  object between two servlets within the same web 
 application?  I have a
  servlet that I have written that maintains a List object 
 that is stored in
  application scope.  This servlet basically creates a new 
 List, then replaces
  the existing one (uses the same name for the object).  My 
 second servlet
  (Struts) simply accesses this List in a read-only fashion - 
 no updates.  I
  can write a basic spin-lock type of mechanism to ensure 
 that my Actions do
  not try to access this List while my first servlet is 
 replacing the object,
  but I'm wondering if there is an easier approach, possibly using a
  synchronized block using the application object
  
  Comments?
  
 
 Synchronizing on the List instance won't help much, because 
 of the way you're
 replacing the old one with a new one -- but it's probably 
 unnecessary as well,
 since the servlet reading the old List and the servlet 
 creating the new List
 are never manipulating the same object instance.
 
 If the servlet doing the modifying was doing it in place on 
 the existing List
 instance, then synchronizing on that instance would indeed be 
 appropriate.
 
  TIA!
  
  Jerry Jalenak
 
 Craig
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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


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



doubt

2003-12-24 Thread Otávio Augusto
hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk anyway. I 
imagine there are users who work with Struts and Hibernate, just like i do (i haven't 
found any hibernate's discussion list, so i'm posting this question here). is someone 
has ever had the lazy instantiation problem when working whith Struts + Hibernate, 
please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

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



Re: doubt

2003-12-24 Thread David Erickson
What kind of problem are you referring to with lazy instantiation?  You can
disable or enable it.. but if you have big lists of items that you may or
may not use its good to leave it on..
-David

- Original Message - 
From: Otávio Augusto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 1:16 PM
Subject: doubt


hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
anyway. I imagine there are users who work with Struts and Hibernate, just
like i do (i haven't found any hibernate's discussion list, so i'm posting
this question here). is someone has ever had the lazy instantiation
problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

-
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: doubt

2003-12-24 Thread Mark Lowe
Hibernate throws that if it finds a null value on an indexed column.

Of example if you've a load of users and groups and say 3 users with 
group_id of 999 and then someone removes group 999 you'd get this 
exception.



On 24 Dec 2003, at 20:16, Otávio Augusto wrote:

hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take 
the risk anyway. I imagine there are users who work with Struts and 
Hibernate, just like i do (i haven't found any hibernate's discussion 
list, so i'm posting this question here). is someone has ever had the 
lazy instantiation problem when working whith Struts + Hibernate, 
please, notice me.

Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

-
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: doubt

2003-12-24 Thread Otávio Augusto
hi

the thing is: i have a bean called Setor, and this bean has an attribute called 
quadras, which is a collection. ok, i can retrieve the ben using hibernate, store it 
in a session (now talking about struts) and go to my jsp page. there, i have this 
piece of code:

tr
tdbean:write name=setores property=nome //tdbrbr
tdbean:write name=setores property=comentario //tdbr
  /tr

logic:iterate id=quad name=setores property=quadras
  tr
tdbean:write name=quad property=nome //td
tdbean:write name=quad property=comentario //td
  /tr
/logic:iterate

Of course, the session was set this way: (setores, setoresObj).
so, with the bean tag, i grab the setores bean, and print its non-collection 
attributes. then, i have to iterate over quadras. is it the correct way? i've read 
hibernate's docs and noticed i can't get this collection values if the many-to-one 
association is a lazy one. how to get and iterate over this collection, then?

thanks for the attention

Otávio Augusto




On Wed, 24 Dec 2003 13:24:04 -0700
David Erickson [EMAIL PROTECTED] wrote:

 What kind of problem are you referring to with lazy instantiation?  You can
 disable or enable it.. but if you have big lists of items that you may or
 may not use its good to leave it on..
 -David
 
 - Original Message - 
 From: Otávio Augusto [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 1:16 PM
 Subject: doubt
 
 
 hi all
 
 Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
 anyway. I imagine there are users who work with Struts and Hibernate, just
 like i do (i haven't found any hibernate's discussion list, so i'm posting
 this question here). is someone has ever had the lazy instantiation
 problem when working whith Struts + Hibernate, please, notice me.
 
 
 Thanks a lot, and, again, pardon if that was not polite.
 
 Otávio Augusto
 
 -
 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: doubt

2003-12-24 Thread David Friedman
Otávio,

Hibernate discussions are at http://http://forum.hibernate.org.  A few of
the discussion threads talk about Struts.  Many cover lazy instantiation.

Regards,
David

-Original Message-
From: Otávio Augusto [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 3:17 PM
To: [EMAIL PROTECTED]
Subject: doubt


hi all

Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
anyway. I imagine there are users who work with Struts and Hibernate, just
like i do (i haven't found any hibernate's discussion list, so i'm posting
this question here). is someone has ever had the lazy instantiation
problem when working whith Struts + Hibernate, please, notice me.


Thanks a lot, and, again, pardon if that was not polite.

Otávio Augusto

-
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: Easy question: iterate

2003-12-24 Thread e-denton Java Programmer
I's iteratin'! Thanks for all the help.

- Original Message - 
From: Daniel Lipofsky [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]; e-denton
Java Programmer [EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 1:07 PM
Subject: RE: Easy question: iterate


%
LabelValueBean[] lvArray = new LabelValueBean[] {
new LabelValueBean(label1, value1),
new LabelValueBean(label2, value2),
new LabelValueBean(label3, value3),
new LabelValueBean(label4, value4) };
request.setAttribute(lvArray, lvArray);
%
logic:iterate name=lvArray id=row indexId=rowIndex
 type=org.apache.struts.util.LabelValueBean
bean:write name=rowIndex/ -
bean:write name=row property=label/ -
bean:write name=row property=value/BR
/logic:iterate

 -Original Message-
 From: e-denton Java Programmer [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 10:24 AM
 To: Struts Users Mailing List
 Subject: Easy question: iterate


 Sorry to bother you with an easy question, but I can't find
 the answer.

 I want to iterate over Category_VO[] which is stored in a
 session attribute.
 I read that it can be done, but I can't find an example for
 raw arrays.

 Here's what I have (which probably doesn't even make sense):

 logic:iterate
  id=category
  collection=com.cnw.portal.database.Category_VO
  type=com.cnw.portal.database.Category_VO
  scope=session
 p bean:write name=category property=shortTitle/
 /logic:iterate


 Thanks!

 will

-
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: doubt

2003-12-24 Thread Otávio Augusto
Thanks a lot David. i've disabled lazy instantiation, and it is working now. but even 
for small tables and not many data, i feel the performance has decreased.

Thanks to all who helped ;)

Otávio Augusto


On Wed, 24 Dec 2003 15:54:09 -0500
David Friedman [EMAIL PROTECTED] wrote:

 Otávio,
 
 Hibernate discussions are at http://http://forum.hibernate.org.  A few of
 the discussion threads talk about Struts.  Many cover lazy instantiation.
 
 Regards,
 David
 
 -Original Message-
 From: Otávio Augusto [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 24, 2003 3:17 PM
 To: [EMAIL PROTECTED]
 Subject: doubt
 
 
 hi all
 
 Maybe this is an inapropriate place to ask that, but i'm gonna take the risk
 anyway. I imagine there are users who work with Struts and Hibernate, just
 like i do (i haven't found any hibernate's discussion list, so i'm posting
 this question here). is someone has ever had the lazy instantiation
 problem when working whith Struts + Hibernate, please, notice me.
 
 
 Thanks a lot, and, again, pardon if that was not polite.
 
 Otávio Augusto
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: [OT] Synchronized access to application-scoped object

2003-12-24 Thread Craig R. McClanahan
Quoting Jerry Jalenak [EMAIL PROTECTED]:

 Craig - 
 
 Thanks for the response.  One last question - during the time period where
 the getServletContext().setAttribute() is executing in Servlet_1, is there
 any concern about collision with an access from Servlet_2 (Struts)?  I guess
 I'm unsure whether the setAttribute() method is synchronized or not
 (the javadoc doesn't say.)
 

You can assume that your app doesn't have to worry about calling
getServletContext().getAttribute() from one thread, and
getServletContext().setAttribute() from another thread at the same time -- the
container guarantees that the internal data structure it is using (in the case
of Tomcat, it's a HashMap that *is* synchronized appropriately) is thread
safe.

The only objects that the application has to worry about w.r.t. thread safety
are its own.

 Thanks!
 
 Jerry Jalenak
 Development Manager, Web Publishing
 LabOne, Inc.
 10101 Renner Blvd.
 Lenexa, KS  66219
 (913) 577-1496
 

Craig


 [EMAIL PROTECTED]
 
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 24, 2003 1:00 PM
  To: Struts Users Mailing List
  Subject: Re: [OT] Synchronized access to application-scoped object
  
  
  Quoting Jerry Jalenak [EMAIL PROTECTED]:
  
   Holiday Greetings to All!
   
   Quick design question - Is it possible to synchronize an 
  application-scoped
   object between two servlets within the same web 
  application?  I have a
   servlet that I have written that maintains a List object 
  that is stored in
   application scope.  This servlet basically creates a new 
  List, then replaces
   the existing one (uses the same name for the object).  My 
  second servlet
   (Struts) simply accesses this List in a read-only fashion - 
  no updates.  I
   can write a basic spin-lock type of mechanism to ensure 
  that my Actions do
   not try to access this List while my first servlet is 
  replacing the object,
   but I'm wondering if there is an easier approach, possibly using a
   synchronized block using the application object
   
   Comments?
   
  
  Synchronizing on the List instance won't help much, because 
  of the way you're
  replacing the old one with a new one -- but it's probably 
  unnecessary as well,
  since the servlet reading the old List and the servlet 
  creating the new List
  are never manipulating the same object instance.
  
  If the servlet doing the modifying was doing it in place on 
  the existing List
  instance, then synchronizing on that instance would indeed be 
  appropriate.
  
   TIA!
   
   Jerry Jalenak
  
  Craig
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 This transmission (and any information attached to it) may be confidential
 and
 is intended solely for the use of the individual or entity to which it is
 addressed. If you are not the intended recipient or the person responsible
 for
 delivering the transmission to the intended recipient, be advised that you
 have received this transmission in error and that any use, dissemination,
 forwarding, printing, or copying of this information is strictly prohibited.
 If you have received this transmission in error, please immediately notify
 LabOne at the following email address: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 




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



Nighty Builds of Struts-Faces Integration Library

2003-12-24 Thread Craig R. McClanahan


Nightly binary builds of the Struts-Faces Integration Library, updated to work
with the new beta release of JavaServer Faces, are now available:

  http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

As always, the source code for this library is in the contrib/struts-faces
directory of the nightly Struts source distro:

  http://cvs.apache.org/builds/jakarta-struts/nightly/src/

This code is *not* ready for prime time yet, but the test application at least
works.  Tops on my list is ensuring that it works with Tiles as well ... most
likely by having two different request processor subclasses and making you
configure the one you need based on whether Tiles is in use or not.  Not quite
as transparent as the old release, but it should be able to work.

Craig

PS:  While nowhere near as cool as the gift of eternal life that we'll be
celebrating tomorrow, please consider this a Christmas gift to all the Struts
developers and users out there :-).


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



Happy Holydays

2003-12-24 Thread Otávio Augusto

Well, maybe that is not the place (again)...but, anyway, merry christmas to all of 
you. Let's build even better days ;)


Otávio Augusto


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



How Do I Handle Two Action Forms

2003-12-24 Thread Caroline Jen
I am stuck and need your knowledge and experience.

When the button is my JSP is clicked, there are two
action forms involved, threadForm and postForm.

The threadForm is populated by hidden fields and text
fields that are passed from the JSP.  All the
properties of the threadForm are to be inserted into a
table in the database by the threadInsert() method and
this method returns a primitive int threadID. 

The properties in the postForm are also populated by
hidden fields and text fields that are passed from the
same JSP, except that the postForm has one additional
properties - threadID, which is obtained from the
insertion of the threadForm into the database. 
Thereafter, all the properties of the postForm are to
be inserted into another table in the database by the
postInsert() method.

How do I handle this situation?  Please help.

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



iterating

2003-12-24 Thread Otávio Augusto
Hi all

Is this piece of code correct??

tr
tdNome do setor: brbean:write name=setores property=nome //tdbrbr
tdComentários: brbean:write name=setores property=comentario //tdbr
  /tr
Quadras:br
logic:iterate id=quad name=setores property=quadras
  tr
tdbean:write name=quad property=nome //td
tdbean:write name=quad property=comentario //td
  /tr
/logic:iterate

In my Action, I'm setting a session this way: 
request.getSession().setAttribute(setores, setor);

The first two lines are correctely printed, but one of the attributes of this bean is 
a Collection. i need to iterate over it.

Thanks 

Otávio Augusto

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