RE: N by N multiboxes !!!

2004-02-19 Thread Lawrence Williams
Hi, 

Thanks for the pointer - although Im not sure this is a case for those tags
(at least I cant work out how to solve my problem using them!)

My issue is that I dont know how many multibox sets I will need on my form
(i.e. it has to have a dynamic number of multiboxes, each with a dynamic
number of name/value pairs).

At present my Action form subclass uses:

private java.util.ArrayList attributeValues = new java.util.ArrayList();
private java.util.ArrayList attributeStatus = new java.util.ArrayList();

to store the possible values and 'check status'. The ArrayLists each hold
LabelValueBean[] and String[] respectively.

This allows me to display a variable number of multiboxes as follows:


html-el:form action=/AdminEditProductAttributes

  c:forEach items=${modifyAttributesForm.attributeNames} var=heading
varStatus=i

c:forEach items=${modifyAttributesForm.attributeValues[i.index]}
var=valuePairs varStatus=j
   html-el:multibox property=attributeStatus[${i.index}]
${valuePairs.value}
 /html-el:multibox
   ${valuePairs.label}
/c:forEach

  /c:forEach
  html-el:submit value=Update Attributes /
/html-el:form

This generates html:

form name=modifyAttributesForm method=post
action=/store-modules/admin/AdminEditProductAttributes.do
h3Size/h3br
input type=checkbox name=attributeStatus[0] value=0S
input type=checkbox name=attributeStatus[0] value=1M
input type=checkbox name=attributeStatus[0] value=2L

h3Colour/h3br
input type=checkbox name=attributeStatus[1] value=0Black
input type=checkbox name=attributeStatus[1] value=1White
brbrinput type=submit value=Update Attributes
/form

So the display works fine - I just cant work out what setters in need in my
form subsclass. The best I can get is a single value for each multibox being
passed using:

public void setAttributeStatus(int i, Object in){
   this.attributeStatus.set(i,in);
}

Any ideas?

TIA

 

-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: 18 February 2004 20:10
To: Struts Users Mailing List
Subject: Re: N by N multiboxes !!!

Study the tutorials at www.keyboardmonkey.com for using the nested Struts
tags.

--- Lawrence Williams [EMAIL PROTECTED] wrote:
  
 Hi,
 
 I am trying to generate a form allowing attributes in a catalog to be 
 set on or off for particular products.
 
 So depending on the state of the Database there will be N Attributes 
 each with M slectable values (as attributes are added and new styles 
 become available N and M will vary:
 
 E.g. 
 
 Color (red,blue.. N .., green)
 Size  (s,m,l,xl)
 .
 .
 N
 .
 .
 Weight (1,2,3)
 
 
 I want a jsp form to display all options for all defined attributes. I 
 currently have a form:
 
 form-bean 
 name=modifyAttributesForm
 type=myproj.product.AttributeForm
 form-property name=attributeNames
 type=java.lang.String[]/
 form-property name=attributeValues
 type=java.lang.Object[]/
 /form-bean
 
 Where each attributeValues object array entry has in it a 
 LabelValueBean[] array storing the values for each attribute.
 
 At present ive got the form of checkboxes rendering using standard 
 html input type=checkbox... Tags.
 
 c:forEach items=${modifyAttributesForm.attributeNames} var=heading
 varStatus=i
 c:forEach items=${modifyAttributesForm.attributeValues[i.index]}
 var=valuePairs varStatus=j
   INPUT name=${heading} type=checkbox
 value=${valuePairs.value}${valuePairs.label}br
 
 /c:forEach
 /c:forEach
 
 I of course now want to use the struts multibox tag to handle all the 
 repopulation for me. However, it seems to me the multibox control is 
 only going to work for a single String[] array of populated values, I 
 need a 2 dimensional structure.
 
 I cant see how I can do this - perhaps I have hit a common pattern here -
?
 Any Ideas?
 
 Lawrence
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.592 / Virus Database: 375 - Release Date: 18/02/2004

N by N multiboxes !!!

2004-02-18 Thread Lawrence Williams
 
Hi,

I am trying to generate a form allowing attributes in a catalog to be set on
or off for particular products.

So depending on the state of the Database there will be N Attributes each
with M slectable values (as attributes are added and new styles become
available N and M will vary:

E.g. 

Color (red,blue.. N .., green)
Size(s,m,l,xl)
.
.
N
.
.
Weight (1,2,3)


I want a jsp form to display all options for all defined attributes. I
currently have a form:

form-bean 
name=modifyAttributesForm
type=myproj.product.AttributeForm
form-property name=attributeNames type=java.lang.String[]/
form-property name=attributeValues
type=java.lang.Object[]/
/form-bean

Where each attributeValues object array entry has in it a LabelValueBean[]
array storing the values for each attribute.

At present ive got the form of checkboxes rendering using standard html
input type=checkbox... Tags.

c:forEach items=${modifyAttributesForm.attributeNames} var=heading
varStatus=i
c:forEach items=${modifyAttributesForm.attributeValues[i.index]}
var=valuePairs varStatus=j
INPUT name=${heading} type=checkbox
value=${valuePairs.value}${valuePairs.label}br

/c:forEach
/c:forEach

I of course now want to use the struts multibox tag to handle all the
repopulation for me. However, it seems to me the multibox control is only
going to work for a single String[] array of populated values, I need a 2
dimensional structure. 

I cant see how I can do this - perhaps I have hit a common pattern here - ?
Any Ideas?

Lawrence


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
 


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



RE: Convert JSP to static HTML...

2004-01-26 Thread Lawrence Williams
how about a shell script that calls wget? ( http://www.gnu.org/software/wget/wget.html 
)
 
Ive used that a couple of times with good results.
 
Cheers
Lawrence

-Original Message- 
From: Manfred Wolff [mailto:[EMAIL PROTECTED] 
Sent: Mon 26/01/2004 14:26 
To: Struts Users Mailing List 
Cc: 
Subject: Re: Convert JSP to static HTML...



Jacob.

*Simple*: When you browse through your app right mouse click View Page
Source and per copy and paste to a html file.

*More difficult*:

That is possible to do automatic. You need a little program that
accessed the side via an URL

http://my.server/myapp/dosomething.do

and gets the http-reqeust to save it into a file. I have written such
thing in delphi to grab websites and get some informations, I think in
java may that not so bad.

Manfred

Jacob Wilson wrote:

Hi All...

I have a specific requirement in my project... I want to convert the JSP 
pages to static html pages and save them in a local directory... How do I achieve this 
functionality??? Any suggestions appreciated.

Thanks much.

-Jacob



-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
 


--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthlt mglicherweise vertrauliche und/oder rechtlich 
geschtzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtmlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten 
Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist 
nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please notify the 
sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



-
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: sql statements

2004-01-16 Thread Lawrence Williams
give your class a properties member:
 
private Properties p;
 
then have a method like this (parameter props is name of properties file):
 
protected boolean loadSQL(String props){  

log.debug(Loading properties (+props+)); 
java.io.InputStream i = null;
try{
p = null;
i = this.getClass().getClassLoader().getResourceAsStream(props);
p = new Properties();
p.load(i);
i.close();
}catch (IOException ioe){
//catch
}
finally {
//finally
} 
   return true;
}
 
 
dont know if that helps

-Original Message- 
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Fri 16/01/2004 17:51 
To: Struts Users Mailing List 
Cc: 
Subject: sql statements



I read somewhere that it's possible to have your sql statements on a
.properties file, instead of a class.

Could anyone give me an idea on how to do that?

Thanks

Kelly.


-
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: Use of html:base/

2003-12-11 Thread Lawrence Williams

If its printing only html:base/ in your browser source then chances are you have not 
referenced the html taglib.

%@ taglib uri=/tags/struts-html  prefix=html %

Regards
Lawrence

-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED] 
Sent: 11 December 2003 14:28
To: struts
Subject: Use of html:base/

Hi,
What is the use of html:base/ tag. How to use it. I am having problem in 
displaying images which are in sudirectories when using forward. I thought this tag 
will solve this. It is printing only html:base/. The directory structure of 
application is as follows.
/
/sales
/sales/images
/sales/lib
   After login user is forwarded to /sales/home.jsp. In this page all links are 
provided like this IMG SRC=images/logo.gif WIDTH=76 HEIGHT=32.
But it is not displayed. If redirect is used then ok. How to change the url ?. Also 
for development purposes the application is in a context named /biz.
In production it will be moved to root of the container.
What is a context relative url and application relative url.

rgds
Antony Paul.



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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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



'Module scoped' variables

2003-12-10 Thread Lawrence Williams
Hi,

Hope this isn't too naïve a question Is there anyway of setting parameters in a 
module-level struts-config file and referencing those variables within an action?

Effectively giving me a module scope.

Regards
Lawrence

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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



RE: 'Module scoped' variables

2003-12-10 Thread Lawrence Williams
Thanks Jonathan,

That's kind of the half solution I have at present - the problem is I have to specify 
the parameter in all my actions as it is 'global to the module'. This makes changing 
the value a bit tedious. Does this make sense?

Regards
Lawrence

-Original Message-
From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] 
Sent: 10 December 2003 16:23
To: 'Struts Users Mailing List'
Subject: RE: 'Module scoped' variables

Not sure if it's exactly what you want but I know you can use the parameter attribute 
of the action tags to specify a value that is accessible using
mapping.getParameter() from withing you Action class.

action
...
...
parameter=someValue/

-Jonathan

-Original Message-
From: Lawrence Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 11:20 AM
To: [EMAIL PROTECTED]
Subject: 'Module scoped' variables


Hi,

Hope this isn't too naïve a question Is there anyway of setting parameters in a 
module-level struts-config file and referencing those variables within an action?

Effectively giving me a module scope.

Regards
Lawrence

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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



Problems with modules

2003-12-05 Thread Lawrence Williams
Hi,

In my web.xml I have defined a default and named module as follows:


init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
/init-param

init-param
param-nameconfig/admin/param-name
param-value/WEB-INF/struts-config-admin.xml/param-value
/init-param

And

  welcome-file-list
welcome-fileindex.jsp/welcome-file
  /welcome-file-list

Where index.jsp is simply:

%@ taglib uri=/tags/struts-logic prefix=logic %
logic:forward name=logon/


However, it seems that when I request the absolute URL:

http://localhost/myApp/admin/ (i.e. index.jsp)

Struts seems to look in my default struts-config.xml rather than in the module 
specific struts-config-admin.xml

i.e. I get 

javax.servlet.jsp.JspException: Cannot find global ActionForward for name logon

The global-forward

global-forwards
forward
name=logon
path=/Logon.do/

Is defined in struts-config-admin.xml 

I can tell struts is looking in the wrong place because if a make a forward in thew 
default config struts resolves the forward

Any suggestions?

TIA 
Lawrence

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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



RE: Problems with modules

2003-12-05 Thread Lawrence Williams
Aman,

Thanks for your reply,

However I cant see what you are suggesting here? Can you describe what you are 
meaning? - 

btw I dont use the application param because as far as im aware it is deprecated in 
favour of the message-resources element.

The crux of my problem is that my index.jsp (Welcome file) cant seem to resolve any of 
my module's global-forwards. However if I type a direct url to 
http://host/app/module/logon.do the module works fine.

Regards
Lawrence



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 05 December 2003 10:51
To: Struts Users Mailing List
Subject: Re: Problems with modules

Hi,
Make the following changes in ur web.xml to ur specific configuration file

  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
 
param-valuefr.improve.struts.webapp.layout.example.ApplicationResources/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param



Thanks  Regards,

Aman Sheriff

---
MoTech Software Pvt. Ltd.
56, Mogra Village Lane,
Andheri East
Mumbai - 400 069

ph : 91 -22 - 821 4541 x 1412
fax :  91 -22 - 820 8757
---

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
 

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



Problem with bean:header

2003-11-18 Thread Lawrence Williams
Hi,

I am using the following in a JSP (Welcome.jsp) - trying to output the User-Agent 
header value.


%@ page language=java %
%@ taglib uri=/tags/struts-bean prefix=bean %
%@ taglib uri=/tags/struts-html prefix=html %
%@ taglib uri=/tags/struts-logic prefix=logic %

...


 logic:present header=User-Agent
   bean:header id=theheader name=User-Agent/
   You are currently running bean:write name=theheader/
 /logic:present


However, Resin3 throws ...


javax.servlet.jsp.JspException: Exception forwarding for name welcome:
javax.servlet.ServletException: com.caucho.jsp.JspParseException: 
com.caucho.java.JavaCompileException:

at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173)
at _index__jsp._jspService(/index.jsp:2)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:551)
at 
com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184)
at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:165)
at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
at com.caucho.server.port.WorkerThread.run(WorkerThread.java:129)
at java.lang.Thread.run(Thread.java:536)



Are there any known issues with this tag? The logic:present seems fine - its just the 
header reference that causes problems.

TIA
Lawrence 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 10/11/2003
 

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