Validation of Indexed Properties

2003-07-28 Thread Nicholas L Mohler




Hi,

I am currently imple,enting the Struts validator into our web app.  All is
going pretty well with the exception of client-side indexed property
validation.  I have looked at the Validator documentation, and gone through
this list looking for some idea that will give me a clue as to what I am
doing wrong.  I have not been able to find anything that makes this work.

I would appreciate any help or direction.

Nick

Code snippets from the various objects that are involved:
struts-config:
   
  
   

validation.xml:
   
  
   


jsp:
   
  
 

 
  
   

Re: Indexed Properties

2003-07-28 Thread Nicholas L Mohler





Atta,

You can use indexed properties in your ActionForm class.  The key is having
all of the correct methods in your form class.

1)  Getter and setter:  You need a get/Set method for the collection that
you refer to in your jsp.  for example:
public Collection getLocations()
public void setLocations(Collection locs)

2) Getter and setter for one instance in the collection.  The name that you
use must match the name you define in your jsp as a single instance from
the collection (specified as the id).  For example:









Your form should in this case have the following get/set methods:
public com.myco.toolkits.beans.Location getOneLocation(int index)
public void setOneLocation(int index, com.myco.toolkits.beans.Location
oneLocation)

Your code may never use either of the "oneLocation" methods, but they are
important for Struts.  When your page is submitted, your two indexed
properties will be submitted as oneLocation[ix].locationName &
oneLocation[ix].locationAddress where ix is the index of the row (0-10 for
example).  As Struts proceses the indexed items, Struts will use the
"getOneLocation" method to get the Collection instance for the provided
index.  This method must resize the collection as needed and then return
the object for the provided index.  For example, if your collection has no
objects and the getter receives an index of 2, the method should load the
first three (0, 1, 2) collection locations with an initialized object and
return the third object.  Struts will then populate the appropriate
property in that object.

As an aside, I tend to use the ArrayList object as my collection type when
working with indexed properties, but I know that the Vector works equally
well.  A simple array will work fine, but the logic to expand the size is a
little more involved.

Let me know if this helps.
Nick



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



Re: Indexed Properties

2003-07-28 Thread Nicholas L Mohler





Atta,

The complaint you are getting is because the property "fruit" is not a
property of the "oneF" bean.  That the oneF object is not a bean with
properties will give you problems.  Depending on your goal, you need to do
something different.  What are you trying to do?

I'm off work in a minute, but I'll check messages at home later this
evening and see if I can help at all.
Nick



   

  "atta-ur rehman" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  com> cc: 

   Subject:  Re: Indexed Properties

  07/28/2003 03:44 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





Thanks very much Nick! It was indeed helpful. I was missing getter/setter
for individual list items!

now my form has following methods:
private String[] fruit = {"Apple", "Orange", "Banana"};

public List getFruits() {

return Arrays.asList(this.fruit);

}

public void setFruits(List l) {

this.fruit = (String[]) l.toArray();

}


public String getFruit(int index) {

if (this.fruit == null) return "null";

return this.fruit[index];

}

public void setFruit(int index, String f) {

this.fruit[index] = f;

}

my JSP has following has this html:iterator:


   

 hi!


 

   
  

and exception i get is this:

javax.servlet.jsp.JspException: No getter method for property fruit of bean
oneF
 at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)


i think it has to do with the fact that my individual fruit is a string
object rather than being a bean in itself if some getter method(s)?

can you see what's going wrong!

Thanks again.

ATTA

- Original Message -
From: "Nicholas L Mohler" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 11:58 AM
Subject: Re: Indexed Properties


>
>
>
>
>
> Atta,
>
> You can use indexed properties in your ActionForm class.  The key is
having
> all of the correct methods in your form class.
>
> 1)  Getter and setter:  You need a get/Set method for the collection that
> you refer to in your jsp.  for example:
> public Collection getLocations()
> public void setLocations(Collection locs)
>
> 2) Getter and setter for one instance in the collection.  The name that
you
> use must match the name you define in your jsp as a single instance from
> the collection (specified as the id).  For example:
>  type="com.myco.toolkits.beans.Location">
> 
>  ="true"/>
> 
> 
>  indexed="true"/>
> 
> 
>
> Your form should in this case have the following get/set methods:
> public com.myco.toolkits.beans.Location getOneLocation(int index)
> public void setOneLocation(int index, com.myco.toolkits.beans.Location
> oneLocation)
>
> Your code may never use either of the "oneLocation" methods, but they are
> important for Struts.  When your page is submitted, your two indexed
> properties will be submitted as oneLocation[ix].locationName &
> oneLocation[ix].locationAddress where ix is the index of the row (0-10
for
> example).  As Struts proceses the indexed items, Struts will use the
> "getOneLocation" method to get the Collection instance for the provided
> index.  This method must resize the collection as needed

Re: Indexed Properties

2003-07-29 Thread Nicholas L Mohler
 on the page. user
> cannot
> define a new block on this page.
>
> In my form I've got String[] getter/setters for blockName and blockType
> properties. In my action, I set both these arrays reading from the
> database.
> Block Names show allright, but the block type dropdown, that is using
> html:select tag, shows same type for all the blocks irrespective of the
> type
> of the block read from database.
>
> Now a few days back i asked a question on this forum regarding how to
> have
> my dropdowns display the right block type as set in the blockType
> String[]
> property of the form. Someone, I think it was Wendy Smoak, and i've seen
> quite a lot of helpful mails from him, mentioned that Indexed Properties
> might be the way go. Althogh, he also mentioned that he hasn't used
> them.
>
> I solved the problem by using "value" property of html:select tag. the
> doc
> says that "value" property denotes the value of the listbox that would
> be
> used to select an item in the list. so far so good.
>
> now the kind of guy i'm, i thought why not try it thrue index properties
> and
> learn something new ;) so i set out to learn indexed properties. read
> some
> articles and still i'm not sure what i'm missing.
>
> Hope this gives you the background and thanks once more for taking some
> out
> to hlep me.
>
> ATTA
>
> - Original Message -
> From: "Nicholas L Mohler" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, July 28, 2003 1:09 PM
> Subject: Re: Indexed Properties
>
>
> >
> >
> >
> >
> >
> > Atta,
> >
> > The complaint you are getting is because the property "fruit" is not a
> > property of the "oneF" bean.  That the oneF object is not a bean with
> > properties will give you problems.  Depending on your goal, you need
> to do
> > something different.  What are you trying to do?
> >
> > I'm off work in a minute, but I'll check messages at home later this
> > evening and see if I can help at all.
> > Nick
> >
> >
> >
> >
> >   "atta-ur rehman"
> >   <[EMAIL PROTECTED]To:   "Struts Users
> Mailing List" <[EMAIL PROTECTED]>
> >   com> cc:
> >Subject:  Re: Indexed
> Properties
> >   07/28/2003 03:44
> >   PM
> >   Please respond to
> >   "Struts Users
> >   Mailing List"
> >
> >
> >
> >
> >
> >
> > Thanks very much Nick! It was indeed helpful. I was missing
> getter/setter
> > for individual list items!
> >
> > now my form has following methods:
> > private String[] fruit = {"Apple", "Orange", "Banana"};
> >
> > public List getFruits() {
> >
> > return Arrays.asList(this.fruit);
> >
> > }
> >
> > public void setFruits(List l) {
> >
> > this.fruit = (String[]) l.toArray();
> >
> > }
> >
> >
> > public String getFruit(int index) {
> >
> > if (this.fruit == null) return "null";
> >
> > return this.fruit[index];
> >
> > }
> >
> > public void setFruit(int index, String f) {
> >
> > this.fruit[index] = f;
> >
> > }
> >
> > my JSP has following has this html:iterator:
> >
> >  > type="java.lang.String" >
> >
> > 
> >  hi!
> > 
> > 
> >  
> > 
> >
> >   
> >
> > and exception i get is this:
> >
> > javax.servlet.jsp.JspException: No getter method for property fruit of
> bean
> > oneF
> >  at
> > org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
> >
> >
> > i think it has to do with the fact that my individual fruit is a
> string
> > object rather than being a bean in itself if some getter method(s)?
> >
> > can you see what's going wrong!
> >
> > Thanks again.
> >
> > ATTA
> >
> > - Original Message -
> > From: "Nicholas L Mohler" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Monday, July 28, 2003 11:58 AM
> > Subject: Re: Indexed P

Re: Indexed Properties

2003-07-29 Thread Nicholas L Mohler





Hi Atta

Just to clatify:
1)  You have a form that contains a "blocks" property which is a collection
of "test.Block" objects.
2)  The "test.Block" object has the following properties(get/set methods
for each): id, name, and category
3)  As we discussesed in our earlier emails, you have the get/set methods
for the "blocks" property in your form.
4)  You also have a singular "getBlock" method that takes an int (index)
and returns the "Block" object from the collection for the given index.

A couple possible causes for the error:
-  Item 4) is not implemented correctly.  You need the method shown below.
Note that since your form is in the session, you shouldn't need the
"sizing" logic.
public Block getBlock(int index) {
  while (index >= this.blocks.size()) {
this.blocks.add(new Block());
  }
  return (Block) this.blocks.get(index);
}

-  When looking at your page, look at the source and confirm that your
indexed properties are named correctly.  You should see block[0].id,
block[0].name, block[0].category.

If none of this helps, I'm not sure where else to look.  It sounds like
everything else is lining up...

Nick




   

  "atta-ur rehman" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  com> cc: 

   Subject:  Re: Indexed Properties

  07/29/2003 12:57 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





Hello again Nick.

Well i've come a step forward in that i've been able to successfully show
the jsp page using index="true" for all the rows and submit the form
without
any errors too:


   

 


 


 
  
 

   
  

works like a charm!

What i'm still missing what is updated when i submit the form? where can i
get updated values from? my ActionForm has list attirbute called "blocks"
each element in the list is a Block bean object. The Block bean has
getter/setters for id, name and category.

In ActionForm I also included setCategory(int) and getCategory(int, string)
which doesn't seem to be called at all!

something obvious that i'm missing?

Thanks.

ATTA


- Original Message -
From: "Nicholas L Mohler" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 2:57 AM
Subject: Re: Indexed Properties


>
>
>
>
>
> Atta,
>
> It sounds to me like you have it.  As long as your names match up, it
> should work fine.  Ajay has given a full code example that looks good.
>
> Nick
>
>
>
>
>   "atta-ur rehman"
>   <[EMAIL PROTECTED]To:   "Struts Users
Mailing List" <[EMAIL PROTECTED]>
>   com> cc:
>Subject:  Re: Indexed
Properties
>   07/28/2003 08:44
>   PM
>   Please respond to
>   "Struts Users
>   Mailing List"
>
>
>
>
>
>
> Yes, I currently have two independent String arrays for blockName and
> blockType. Putting them, and all the other block related properties, is
> what
> seems to be the right thing to do! So you have confirmed.
>
> here is what i have understood from your text:
>
> 1) my form would 

Re: struts problem(Unable to populate the form in the jsp to ActionFormbean)

2003-08-09 Thread Nicholas L Mohler





Sridhar,

See the thread from 7/28-7/30 titled inxeded properties.  Everything you
need is in that thread.  The basic problem here is that your Form class
properties and your jsp names need to line up properly.  The thread I
mentioned should help you out.

Nick



   

  Paul Thomas  

  <[EMAIL PROTECTED]To:   struts-user <[EMAIL 
PROTECTED]>  
  co.uk>   cc: 

   Subject:  Re: struts problem(Unable to 
populate the form in the jsp to ActionForm bean) 
  08/08/2003 06:19 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   






On 08/08/2003 02:11 Sridhar Kotagiri wrote:
> Hi,
>I have a Action form which contains an arraylist the array list adds
> beans which are called IpAddress(two String properties).I am able to
> display in the jsp page but when I submit this form it is unable to
> populate to the action form.
>
>
>
>
> bundle="content" key="title.ipaddresses"/>
> border="0">
> property="alist">
> style="width:150px;">

> property="domainName"
> />
>
 bundle="content"
> key="common.pointsto"/>
> property="ipValue"
> />

>
>
>
>
>
>
>
>
>
> public class EditAdvancedForm extends ValidatorForm {
> //~ Instance fields
> 
>
>private String domain_Id;
>private ArrayList alist;
>private IpAddress ip1;
>
>public EditAdvancedForm(){
>alist=new ArrayList();
>ip1=new IpAddress();
>
>}
>
>public void setDomainName(String name)
>{
>ip1.setDomainName(name);
>}
>public String getDomainName()
>{
>return ip1.getDomainName();
>}
>public void setIpValue(String name)
>{
>ip1.setIpValue(name);
>alist.add(new
> IpAddress(ip1.getDomainName(),ip1.getIpValue()));
>}
>public String getIpValue()
>{
>return ip1.getIpValue();
>}
>
>/**
> * @return
> */
>public String getDomain_Id() {
>return domain_Id;
>}
>/**
> * @return
> */
>public IpAddress getIp1() {
>return ip1;
>}
>
>/**
> * @param address
> */
>public void setIp1(IpAddress address) {
>ip1 = address;
>}
>
>/**
> * @return
> */
>public ArrayList getAlist() {
>return alist;
>}
>
>/**
> * @param list
> */
>public void setAlist(ArrayList list) {
>alist = list;
>}
>
> }
>
>
>
> public class IpAddress {
>private String domainName;
>private String ipValue;
>private String flag;
>private String flag1;
>
>public IpAddress(String str1,String str2)
>{
>this.setDomainName(str1);
>this.setIpValue(str2);
>}
>   

RE: [FRIDAY] Impossible requirements & customer expectation management [WAS: methodto get new Id to next action when old Id is in request?]

2003-08-10 Thread Nicholas L Mohler





My experience...you have to explain the consequences in layman's terms (no
"geek talk", and yes, I am a computer geek).  If you can, instead of
explaining why the software won't work given the requirement, and a
real-life example that the customer can relate to and understand...for
example, it's like trying to tie my shoes when I'm not allowed to have
shoe-laces (I wouldn't use that one).  A good analogy can sometimes go a
lot further that a brilliant explanation.

Nick



   

  "Andrew Hill"

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  idnode.com>  cc: 

   Subject:  RE: [FRIDAY] Impossible 
requirements & customer expectation management [WAS:  
  08/08/2003 07:28 AM   method to get new Id to next 
action when old Id is in request?]
  Please respond to

  "Struts Users Mailing

  List"

   

   





So what does one do when one has requirements that are (for all practical
purposes) impossible?

How does one actually go about convincing a Customer/PHB/VIP that its
impossible without them thinking one is incompetent and making excuses?

-Original Message-
From: ansuman_behera [mailto:[EMAIL PROTECTED]
Sent: Friday, 8 August 2003 19:20
To: Struts Users Mailing List
Subject: RE: [FRIDAY] method to get new Id to next action when old Id is
in request?


no offence meant James but I've had past experience when the so called
architects and designer of my client have asked me not to use hidden
variables...period...

they would not listen to anything, they would not discuss about and hence
my
question. Obviously you do understand that the answer given by you is
something I cannot tell to my customers but thanks for answering anyway.

ansuman

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 4:43 PM
To: Struts Users Mailing List
Subject: RE: method to get new Id to next action when old Id is in
request?


That's ridiculous.  If that were true, then just give up and go home.


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx




> -Original Message-
> From: ansuman_behera [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 2:51 AM
> To: Struts Users Mailing List
> Subject: RE: method to get new Id to next action when old Id is in
> request?
>
>
> what if there is a restriction that the developers should not be
> using hidden variables? what do you do in this case?
>
> -Original Message-
> From: Rohit Aeron [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 11:54 AM
> To: Struts Users Mailing List
> Subject: RE: method to get new Id to next action when old Id is in
> request?
>
>
> Try putting up id as a hidden variable...
>
> Eg:
>
> 
>
>
> it would work
>
> regards
> Rohit
>
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 2:56 AM
> To: Struts Users Mailing List
> Subject: method to get new Id to next action when old Id is in request?
>
> I have two actions chained together. They both take the same formbean.
> The first is sectionInsert.do and the second, which sectionInsert
> forwards to on success, is sectionEdit.do
>
> sectionInsert.do receives the properties of a Section in the request
> parameters, including id=0 where it is 0 because it does not exist in
> the DB yet. So it inserts the new Section into the DB and returns the
> new id, which is needed by sectionEdit to put into the html for the edit
> page.
>
> I originally thought I could save the new id to the formbean and this
> would get passed on, but sectionEdit instantiates its own formbean and
> fills it with the request parameters - include id=0.
>
> Is there an intuitive way of passing on the new id?
>
> I already use sectionEdit.do as a first action by cal

RE: Dumbo Question

2003-08-14 Thread Nicholas L Mohler





Look at the way that you have named your "ColumnNames" property in the jsp
and your form.  Try it with property="columnNames" with form methods
getColumnNames and setColumnNames.  We've had seen that problem a couple
times on our team and lining the names up properly does the trick.

Nick




   

  "Mehta, Chirag (IT)" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  tanley.com>  cc: 

   Subject:  RE: Dumbo Question

  08/14/2003 11:11 AM  

  Please respond to

  "Struts Users Mailing

  List"

   

   





My code is:


 

  


Results.java is the name of an ActionForm which has my collections as
get and set properties.

This is created using an DataBaseConnect class which is initialised in
my Action class.

Hope that helps.

Chirag

-Original Message-
From: Adam Levine [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 16:01
To: [EMAIL PROTECTED]
Subject: Re: Dumbo Question


How are you attempting to display and iterate?  code snippets help us
find
out what's going on




From: "Mehta, Chirag (IT)" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Dumbo Question
Date: Thu, 14 Aug 2003 15:58:48 +0100

Sorry, heres another newbie question.

I have a bean that stores collections of data that have been retrieved
from a database.

When I try and logically iterate these collections on my JSP page, it
says "Cannot find bean Results in any scope"

But my bean does exist and println its results on my tomcat window?

What am I doing wrong?


Thanks

Chirag




--
NOTICE: If received in error, please destroy and notify sender.  Sender
does
not waive confidentiality or privilege, and use is prohibited.

_
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


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



--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.

-
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: Dynamically generating Action Forms

2003-08-14 Thread Nicholas L Mohler





I have a similar function where I allow the user to view the contents of
various DB tables in my system.  My process works like this:

1)  I build a collection of the column names that will be shown.

2)  I then extract the values for each row from the ResultSet using the
collection of column names and put those values into a collection.  I end
up with a collection (rows) of collections (column data in row).

3)  You can then put the collection of column names and the collection of
rows wherever you want them (a form or into context).

4)  Your JSP then processes the three collections:
  Iterate through the collection of column names for the table headings
  Iterate through the collection of Rows to build each row in your
table
Iterate through each Row collection to each column for the row.


  

  



  

  

  


Hope this helps...
Nick



   

  "Mehta, Chirag (IT)" 

  <[EMAIL PROTECTED]To:   <[EMAIL PROTECTED]>  

  tanley.com>  cc: 

   Subject:  Dynamically generating 
Action Forms   
  08/14/2003 07:07 AM  

  Please respond to

  "Struts Users Mailing

  List"

   

   





Hello,

Does anyone know if there is a way of generating an Action form from the
resultset's column metadata?

I have a jsp that allows the user to enter SQL statements. I do not know
what thier query will be so from the resultset I would like to create
action forms according to the columns to use to display their results?

Anyone have any clue?

Cheers

Chirag




--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.




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



Re: Form Populating Error, help!!

2003-08-14 Thread Nicholas L Mohler





Not sure why this works when the form is in the session, but I think I see
why it doesn't work in the request...

I am pretty sure this is a naming issue.  I would suggest changing the name
of the singular "indexedBeans" to "indexedBean" in two places:
1)  In your JSP, the id attribute in the iterate tag represents one item in
your collection.  When the form is submitted, Struts will use this name to
get an instance of the indexedBean for the index that is provided with the
attribute from the form: for example, indexedBean[5].description would get
the PermissionLine object for the index 5.
2) In your form, the indexed getter should match the singular name you
choose: getIndexedBean(int index) for example.

Hope this helps.
Nick



   

  "David Erickson" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  x.com>   cc: 

   Subject:  Re: Form Populating Error, 
help!! 
  08/14/2003 03:13 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





I forgot to mention this code works with no problems when the scope of the
form is in session... *boggles*

- Original Message -
From: "David Erickson" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 12:37 PM
Subject: Re: Form Populating Error, help!!


> I was thinking it had something to do with this function:
> public PermissionLine getIndexedBeans(int index) {
>
>
> System.out.println("Index Requested: " + index + " Size of Array: " +
> this.myBeans.size());
>
> while (index >= this.myBeans.size())
>
> this.myBeans.add(new PermissionLine());
>
> return (PermissionLine) this.myBeans.get(index);
>
> }
>
> But i through that debugging code in there and it never gets output at
all..
> so it must be something to do with the populate function on copying
getters
> and setters from the form to the bean, but its the exact same bean i used
to
> populate it with, doesnt make any sense.. anyone got any ideas?
>
> - Original Message -
> From: "Alawadhi, Mona" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, August 14, 2003 12:04 PM
> Subject: RE: Form Populating Error, help!!
>
>
> > It looks like there is a method expecting a certain type of param, and
> it's
> > getting something other than expected.
> >
> > -Original Message-
> > From: David Erickson [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 14, 2003 2:01 PM
> > To: Struts Mailing List
> > Subject: Form Populating Error, help!!
> >
> >
> > Getting this error:
> > exception
> >
> > javax.servlet.ServletException: BeanUtils.populate
> > at
> > org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
> > at
> >
>
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j

> > ava:821)
> > at
> >
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)

> > at
> > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> > at
> > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
> > root cause java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> > at java.util.ArrayList.RangeCheck(ArrayList.java:508)
> > at java.util.ArrayList.get(ArrayList.java:320)
> > at
> >
>
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.

> > java:521)
> > at
> >
>
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.

> > java:428)
> > at
> >
>
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j

> > ava:770)
> > at
> >
>
org.apache.commons.beanutils.Propert

RE: Help please - indexed field in ActionForm

2003-08-14 Thread Nicholas L Mohler





Hi Dave,

There was a good thread about using indexed properties a little over a week
ago (7/28-7/30).  Find that thread and you should find all of the answers
that you need in order to use and process indexed properties on your form.
Even though the thread wanders a little, everything that you need is there.

Nick



   

  Erez Efrati  

  <[EMAIL PROTECTED]To:   "'Struts Users Mailing 
List'" <[EMAIL PROTECTED]>
  et.il>   cc: 

   Subject:  RE: Help please - indexed 
field in ActionForm 
  08/07/2003 09:09 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





You could also try the following:


 label:


You could also make use of the  and get rid of the
name="myForm", but this a bit more advanced.

Don't forget to put :
<%@ taglib uri="/tags/struts-html-el" prefix="html-el" %>

HTH,
Erez

-Original Message-
From: David Thielen [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 1:39 AM
To: Struts Users Mailing List
Subject: Re: Help please - indexed field in ActionForm

Hi;

Thank you - this is part of what I need.

Is there any way to iterate through the lines if I don't know up front
how
many lines there will be? I tried the with the c JSTL and it doesn't
work.

thanks - dave


- Original Message -
From: "Gary Kephart" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 4:55 PM
Subject: RE: Help please - indexed field in ActionForm


class MyActionForm
{
  private static final MAX_ENTRIES = 50;
  private String[] text;

  public MyActionForm()
  {
text = new String[MAX_ENTRIES];
  }

  public String[] getText() {return text;}

  public void setText(int index, String newText) {text[index] =
newText;}
}

my.jsp

  

  Label 1:
  Label 2:
  

  



Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318


> -Original Message-
> From: David Thielen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 3:46 PM
> To: Struts-Users
> Subject: Help please - indexed field in ActionForm
>
>
> Hi;
>
> I've been fighting this all day with no luck. And it has to
> be a simple thing to do.
>
> I have a form where I have N lines in it. Each line needs to
> have some text displayed and an edit box.
>
> How do I set this up in the .jsp file and in the ActionForm?
> I've found a number of examples on the web but they all have
> incomplete code and my guesses for the rest of the code have
> not been right so far.
>
> thanks - dave
>

-
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: Dumbo Question

2003-08-15 Thread Nicholas L Mohler






Chirag,

I looked at your code, and it looks right.  It makes me think that
something must be wrong with the data.  Your data should look like this:

- You have an object called Results in scope that has a collection property
called tabledata (tbdata).
- Each object in the tbdata collection is itselt a collection of objects
(rowData)

Verify that your data looks like that...if your data looks right, then I'm
stumped as your code looks right.
Nick





   

  "Mehta, Chirag (IT)" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  tanley.com>  cc: 

   Subject:  RE: Dumbo Question

  08/15/2003 06:44 AM  

  Please respond to

  "Struts Users Mailing

  List"

   

   





Ok. Got a step further but spent the last 2 hours trying to figure this
out. This is my code in my JSP page.
I get an error of org.apache.jasper.JasperException: Cannot find bean
rowData in any scope.

The second logic iterate is on a 2D Collection. It will display tbdata
if I ask it too but the whole row of data goes in a cell. But I would
like to put one piece of data in each cell. Ie:

Test Test
   Test

NOT

Test|Test|Test   Test|Test|Test
Test|Test|Test





 
  
   


 
  
   





Please help someone!

Chirag


--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.

-
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: Dumbo Question

2003-08-15 Thread Nicholas L Mohler





I'm not sure what is wrong then...I've pasted some code snippets from my
working code.  There really isn't anything special that you need to do.  As
long as the data is constructed correctly, and the data/context names
correclty line up, it should work... :-)

Hope that you see something helpful in the following code snippets...
Nick

In the class that accesses the DB, I have the following:
answer.setColumnNames(columns);

while (results.next()) {
  Iterator columnIter = columns.iterator();
  Collection dataValues = new ArrayList();
  while(columnIter.hasNext()) {
String dataValue = results.getString(columnIter.next().toString
());
if (dataValue == null) {
  dataValue = "";
}
dataValues.add(dataValue);
  }
  answer.addToColumnData(dataValues);
}

Note that "answer is a bean that has two collection objects: columnNames
and ColumnData.  The addToColumnData() method adds to the collection of
columnData.


In the ActionClass, the "answer" object is put into the request with a name
defined by "DBTablesReportAction.TABLE_REPORT_LIST"

In the jsp:

  ">


  


  






   

  "Mehta, Chirag (IT)" 

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  tanley.com>  cc: 

   Subject:  RE: Dumbo Question

  08/15/2003 08:17 AM  

  Please respond to

  "Struts Users Mailing

  List"

   

   





DOH! That's exactly what I have done.

Is there anywhere were I have to state that the tabledata contains
ojects of type List?

And is there anything I might have to configure in my config.xml or my
ActionClass.

The weird thing is that the first iterate works fine - for the column
headings.

And the outer loop in the second iterate works too. It will print out
the collection in cell one of the tabledata for example.



-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: 15 August 2003 12:09
To: Struts Users Mailing List
Subject: RE: Dumbo Question








Chirag,

I looked at your code, and it looks right.  It makes me think that
something must be wrong with the data.  Your data should look like this:

- You have an object called Results in scope that has a collection
property
called tabledata (tbdata).
- Each object in the tbdata collection is itselt a collection of objects
(rowData)

Verify that your data looks like that...if your data looks right, then
I'm
stumped as your code looks right.
Nick







  "Mehta, Chirag (IT)"

  <[EMAIL PROTECTED]To:   "Struts
Users Mailing List" <[EMAIL PROTECTED]>
  tanley.com>  cc:

   Subject:  RE: Dumbo
Question
  08/15/2003 06:44 AM

  Please respond to

  "Struts Users Mailing

  List"









Ok. Got a step further but spent the last 2 hours trying to figure this
out. This is my code in my JSP page.
I get an error of org.apache.jasper.JasperException: Cannot find bean
rowData in any scope.

The second logic iterate is on a 2D Collection. It will display tbdata
if I ask it too but the whole row of data goes in a cell. But I would
like to put one piece of data in each cell. Ie:

Test Test
   Test

NOT

Test|Test|Test   Test|Test|Tes

Re: writing an actionform for nested indexed properties

2003-08-21 Thread Nicholas L Mohler





Cameron,

Are you sure that your request attributes are named that way?  I read that
as a 3 dimensional table...do you really have that in your page?

If you are getting those request attributes, then I'm stumped, but I'd love
to know the answer :-)

Otherwise...you need a getter/setter for the collection which get s and
sets a collection of "bean" objects.  You also need a get method for a
single element in your indexed collection.  For example:

public Collection getIps() {return ips;}
public void setIps(ArrayList ips) {this.ips = ips;}

public ItemProperties getIp(int index) {
  while (index >= ips.size()) {
ips.add(new ItemProperties());
  }
  return (ItemProperties)ips.get(index);
}

Nick



   

  "Cameron Hickey" 

  <[EMAIL PROTECTED]To:   "'Struts Users Mailing 
List'" <[EMAIL PROTECTED]>
  com> cc: 

   Subject:  writing an actionform for 
nested indexed properties   
  08/21/2003 10:00 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





I am trying to write an actionform which will properly handle an array
of indexed properties which look like this:

ip[0].itemPropertys[0].itemPropertyId
ip[0].itemPropertys[0].value

ip[1].itemPropertys[0].itemPropertyId
ip[1].itemPropertys[0].value

etc...


In my Action form, what getters and setters do I need?

This is what I have so far:

public List getIp() { return ip;}
public void setIp(List ipList) {ip = ipList;}

public List getItemPropertys(int idx) {return (List) ip.get(idx); }
public void setItemPropertys(int idx,ItemProperty ipe)
{ip.set(idx,ipe);}

public ItemProperty getItemProperty(int idx, List ipl) {return
(ItemProperty) ipl.get(idx);}
public void setItemProperty(int idx,List ipl, ItemProperty tip)
{ipl.set(idx,tip);}

public String getValue(ItemProperty tip) {return tip.getValue();}
public void setValue(String s, ItemProperty tip) {tip.setValue(s);}

public int getItemPropertyId(ItemProperty tip) {return
tip.getItemPropertyId();}
public void setItemPropertyId(int i, ItemProperty tip)
{tip.setItemPropertyId(i);}




but when I try to submit the form, I get this error:


java.lang.NullPointerException
 at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt
ils.java:497)
 at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt
ils.java:410)
 at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti
ls.java:729)
 at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav
a:780)
 at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:793)
 at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726)


which I assume is coming from the fact that I don't have all the right
getters and setters available, since it must be trying to call one that
does not exist (thus the null pointer).

Is this right?

Should I have other getters and setters?



THANKS FOR ANY HELP!!

Cameron


-
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 : RE : Validator and Dispatch Actions

2003-08-26 Thread Nicholas L Mohler





We have a similar situation using action classes based on the
LookupDispatchAction.  We have not implemented this yet, but our approach
will be to have two action mappings.  We'll do the following:

In the form class, we'll override validate() to do three things:
1)  call super.validate().
2)  If ActionErrors are returned, we'll change the dispatchAction (used to
map to the method) in the form/request, adding something like
"ValidationFailed" to the existing value.
3)  Return the ActionErrors.

The first mapping will have validate="true", so the server-side validation
will be used.  The input attribute will be a forward to the second mapping,
which will look exactly like the first, except that validate will be set to
"false".

The second mapping will look like the first, but validate will be "false".
It will be responsible for forwarding back to the edit page from which the
validation error originated.

The ActionClass (actually the super class that implements some default
behaviors) will also implement methods to support the possible validation
failure methods.  These methods will simply forward to the appropriate
mapping, insuring that the form is in the request - if applicable, any
other needed objects would be addressed here as well.  For example
(simple):

public ActionForward saveNewValidationFailed ActionMapping mapping,
ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
throws IOException,
  ServletException {
  request.setAttribute(EDIT_FORM_NAME, form);
  return mapping.findForward(FORWARD_ADD)
}

public ActionForward saveUpdateValidationFailed ActionMapping mapping,
ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
throws IOException,
  ServletException {
  request.setAttribute(EDIT_FORM_NAME, form);
  return mapping.findForward(FORWARD_EDIT)
}

I can't guarantee that this is the right way, or even that it would work
since we have yet to implement it, but it sounds reasonable to our team.
Nick



   

  "thomas  

  Sontheimer"  To:   "'Struts Users Mailing List'" 
<[EMAIL PROTECTED]>
Subject:  RE : RE : Validator 
and Dispatch Actions  
   

  08/26/2003 04:37 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





if you want to use different validation rules with the validator you
have to declare different action elements in your struts-config.xml file
(using the same action class if you want).

another means is to validate your form in the methods of your action
class as propose Koni in the mail sent on the list Monday, August 25,
2003 8:04 PM:

struts-config.xml:


 


LogonAction.java:

   ActionErrors errors = new ActionErrors();
   errors = form.validate(mapping, request);

   // Report any errors we have discovered back to the original form
   if (!errors.isEmpty())
   {
   saveErrors(request, errors);
   return  new ActionForward(mapping.getInput());
   }

thomas

> -Original Message-
> From: manglu [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 26, 2003 5:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: RE : Validator and Dispatch Actions
>
>
> Thomas,
>
> How do i have 3 actions here?
>
> I have only one action with three methods each working on
> SEARCH, CREATE
> and EDIT.(which is why i use the dispatch Action)
>
> Appreciate any other thoughts.
>
> TIA,
> Manglu
>
>
>
> thomas Sontheimer wrote:
> > you have to use (Dyna)ValitatorActionForm instead of
> > (Dyna)ValidatorForm. Then in your validation.xml file for each new
> > rule y

Re: Validator with property String array problem

2003-08-26 Thread Nicholas L Mohler






I have done some work with client-side indexed field validation...mostly, I
have written a couple custom validations that can validate indexed or
non-indexed fields based on a few attributes that I set in validation.xml.

My validators are somewhat pointed towards my particular needs and the way
that my indexed properties are build, but not quite applicable to any
application...not yet at least.

If you already have javascript code to maintain the indexed attributes (a
table that can shrink and grow), then you already have a lot of the code
that will help you write your own custom validation...

Nick




   

  David Graham 

  
  yahoo.com>   cc: 

   Subject:  Re: Validator with property 
String array problem  
  08/26/2003 02:27 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





The server side checks were fixed but the javascript is still limited to
single fields.

David

--- Suhel Rizvi Hotmail Account <[EMAIL PROTECTED]> wrote:
> Hi David,
>
> Thanks for the info but still not made progress and wonder if you can
> help
> or point me in the right direction for implementation guidance.
>
> I tried downloading latest nightly build of commons-validator
> (commons-validator-20030826.zip) and deployed it into my application to
> the
> WEB-INF/lib directory but still got the same result as before
> (validation
> occurs but no pop up error messages appearing)
>
> Am I using the correct syntax in the strut-config.xml and validation.xml
> and
> my jsp or do I need to change it? Are there any online notes as to how
> to
> correctly use the fixed commons-validator for validating propety String
> arrays ?
>
> Thanks and regards
>
> Suhel
>
> - Original Message -
> From: "David Graham" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, August 22, 2003 2:41 PM
> Subject: Re: Validator with property String array problem
>
>
> > Commons Validator was recently modified to allow the required
> validation
> > in Struts to run on String[] or Collection objects.  You can download
> the
> > latest Validator nightly build to try it out.
> >
> > David
> >
> > --- java-dude <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > I am having problems using  Validator framework to perform client
> > > side validation on a String array property declared in a
> > > DynaValidatorForm.
> > >
> > > The results are that the validation does seem to work in a fashion
> > > such that the user is not taken to the next page and is kept on
> > > current jsp while data entered is invalid BUT no pop up alert error
> > > messages are being diplayed. (For other forms in the application
> > > where I am validating single properties the validation and pop up
> > > error messages are working fine.)
> > >
> > > Has anybody solved/encountered this problem ?
> > >
> > > I have provided the relevant snippets from my current configuration
> > > to illustrate my implementation :-
> > >
> > > struts-config.xml
> > > =
> > > .
> > > .
> > > .
> > >  > >  name="enterReadingForm"
> > >  type="org.apache.struts.validator.DynaValidatorForm">
> > >  
> > > 
> > > .
> > > .
> > > .
> > >
> > > validation.xml
> > > ==
> > > .
> > > .
> > > .
> > > 
> > >> >   depends="required,minlength,maxlength,mask">
> > > 
> > >  > >  resource="false"/>
> > >  > >  resource="false"/>
> > > 
> > > minlength
> > > 1
> > > 
> > > 
> > > maxlength
> > > 6
> > > 
> > > 
> > > mask
> > > ^[0-9]*$
> > > 
> > >   
> > > 
> > > .
> > > .
> > > .
> > >
> > > 

Re: understanding

2003-09-26 Thread Nicholas L Mohler





If you do not specify a name attribute, then an assumption is made that the
specified property  is an attribute in the form that is associated with the
mapping.

If you have a mapping (SampleAction) that uses a form (SampleForm), then
the example you gave below assumes that the SampleForm object has an
attribute called "fields" that is a collection.

Nick



   

  "Prashanth.S"

  <[EMAIL PROTECTED]To:   Struts Users Mailing List 
<[EMAIL PROTECTED]>
  o.com>   cc: 

   Subject:  Re:  
understanding 
  09/26/2003 09:41 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





Hi julie,
Thanks for the reply but i wanted to know what does this property="fields"
denote as there is no name attribute used in it???

Thanks
Prashanth




[EMAIL PROTECTED] wrote:
use the "propery" ...in your case it is fields




"Prashanth.S"
09/26/03 09:04 AM
Please respond to "Struts Users Mailing List"


To: [EMAIL PROTECTED]
cc:
Subject: understanding


Hi all,
i found this tag while going through one of jsps but i couldnt understand
what this denotes

I dont find any name attributeThan how can a property attribute can be
used..
Thanks
Prashanth



-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search



= = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =
This transmittal and any attachments may contain confidential, privileged
or sensitive information and is solely for the use of the intended
recipient. If you are not intended recipient, you are hereby notified that
you have received this transmittal and any such attachments in error and
any review, dissemination, distribution or copying thereof is strictly
prohibited. If you have received this transmittal and any attachments in
error please notify the sender and immediately destroy the message and all
its attachments. Any opinions herein expressed may be those of the author
and not necessarily of Mizuho Corporate Bank, Ltd (the "Bank"). The Bank
accepts no responsibility for the accuracy or completeness of any
information herein contained.
= = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =



-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search




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



Question about minimizing javascript loaded into web page

2003-10-01 Thread Nicholas L Mohler






I apologize if this is a question that has already been addressed, but I've
not been able to find an answer...

We have implemented the validation framework into our webapp and it works
well.  We have noticed that all of the validation javascript is loaded into
the web page, even if the validation is not applied on the page.  The
loaded javascript can be over half of the loaded page's content.

I think my javascript tag (struts-html:javascript) looks right.  The
dynamic javascript is built as expected, but the static javascript just
brings in everything.  Has anybody sen this before?

I appreciate any guidance.
Nick



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



RE: Question about minimizing javascript loaded into web page

2003-10-02 Thread Nicholas L Mohler





Saul,

Thanks for the responses to the question.  So you are suggesting that I
have a jsp that really has the sole purpose of acting as a javascript
container that will be usable on the client side, but not rendered to the
page.  This may be a dumb question: is that possible?  The jsp would use
the html:javascript tag to bring in the static javascript from the
validation framework.

Is my understanding correct?
Nick




   

  "Brian McSweeney"

  
  aurium.net>  cc: 

   Subject:  RE: Question about minimizing 
javascript loaded into web page 
  10/02/2003 11:00 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





Helps very much Saul. Cheers.

Final dumb question:

So is the result of this that only the javascript methods pertaining to
each jsp gets loaded into the page?

If so, do you know why this isn't the default behaviour?

Thanks,
Brian


-Original Message-
From: Yuan, Saul (TOR-ML) [mailto:[EMAIL PROTECTED]
Sent: 02 October 2003 13:46
To: Struts Users Mailing List
Subject: RE: Question about minimizing javascript loaded into web page

>
> Hi Saul,
> Could you explain this a little more. I'm interested too.
>
> For example, at the moment I'm just using the tag:
>
>  
>
> This brings down all the validator javascript in the page.
>
> 1) Is this what you mean by "static javascript"?

yes


>
> 2) What exactly would you put in the staticJavascript.jsp page?

Pulled from the struts example application, basically it's setting
dynamicJavascript="false" staticJavascript="true"

staticJavascript.jsp:
-

<%@ page language="java" %>
<%-- set document type to Javascript (addresses a bug in Netscape
according to a web resource --%>
<%@ page contentType="application/x-javascript" %>

<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %>



-
>
> 3) What's the difference between static and dynamic javascript?
> (Probably a
> real dumb question :-) )

dynamic javascripts are generated based on the particular fields of your
jsp page, say, the validation error messages etc. The static javascripts
are those validation javascript functions as defined in the
validator-roles.xml file.


Hope this helps.

Saul


>
> Am a bit confused :-)
> Thanks,
> Brian
>
>
> -Original Message-
> From: Yuan, Saul (TOR-ML) [mailto:[EMAIL PROTECTED]
> Sent: 01 October 2003 21:09
> To: Struts Users Mailing List
> Subject: RE: Question about minimizing javascript loaded into web page
>
> If you don't want static javascript rendered inside your jsp page, you
> can set:
>
> staticJavascript="false" and have  reference the static part.
>
> Something like below:
>
>  dynamicJavascript="true" staticJavascript="false" />
>
>