RE: javascript and Struts

2003-04-04 Thread Niesen, Nathan
Using indexes to access page elements is not a good practice. You should
access the elements by id or through association whenever possible.

In your case, the following should be sufficient:
onchange="this.form.submit();"

If you need to do some preprocessing, I'd recommend the following pattern:

[...]
function onChangeCampaignName(aForm) {
// do preprocessing
aForm.submit();
};
[...]

[...]

Nathan.

 -Original Message-
From:   Oliver Reflé [mailto:[EMAIL PROTECTED] 
Sent:   Friday, April 04, 2003 5:31 AM
To: Struts
Subject:javascript and Struts

Hi Guys,
i have a strange problem. Maybe you can help me. I would like to submit a
form when a select box value
has changed.Here is the code like i try it:



DatenfeldWert
Kampagnenname:






...

I also trid javascript:{document.forms[0].submit()} etc. but nothing worked.
When i try this now on
a normal HTML form it works. But with the struts form i get the message.
Method not supported by object.

But i cannot imagine why this happens, cause javascript is executed on
client side and there the code
is the same.

So do you have any idea ??

Thx in advance

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



RE: html:select

2003-04-03 Thread Niesen, Nathan
Use the value attribute on the html:select tag.

 -Original Message-
From:   Jesse Vitrone [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, April 02, 2003 1:47 PM
To: [EMAIL PROTECTED]
Subject:html:select

I'm pretty new to the jsp tag stuff, and I need to do something that I would
think is pretty common, but I can't seem to do it without resorting to
scriptlets.
 
I have an Address, which has a String state on it.
I have a Collection of States which have an int id, and String name on them.
 
How can I generate a select list that defaults to the value that matches the
state on my Address?
 
Seems like this would be pretty common, but I can't find it anywhere :(
 
Thanks in advance,
Jesse

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



RE: Netscape 4.7 & disable fields

2003-04-01 Thread Niesen, Nathan
You could also have an onfocus event handler that calls blur() on the field
or sets focus to the next field. They can't change the field if they can't
put the cursor in it. This affects tabbing from field to field.


 -Original Message-
From:   Moore, Scott R. [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, April 01, 2003 11:26 AM
To: 'Struts Users Mailing List'
Subject:RE: Netscape 4.7 & disable fields


Potential workaround to keep those 3 ns4 users happy (actually i think
there's more like 7):

- Clicking the button sets a Javascript variable "disableTextBoxes" to true
- The textboxes have an onchange function that:
- if disableTextBoxes is false, it stores the textbox value in an array
- if disableTextBoxes is true, it changes the textbox value back to the
previous value saved in the array

So when disableTextBoxes is true, the user could edit the field value, but
as soon as the focus leaves that field it will change back to its orig
value--it's in effect uneditable.

A nice extra touch would be to have an onfocus handler in the textboxes that
calls a function tellUserIfDisabled().  tellUserIfDisabled() checks
disableTextBoxes, and if it is true, shows them an alert saying that they
shouldn't change the value in that textbox.

It's a total hack but having had to work with NS 4.7 before I got used to
doing such things...  ugh.

HTH,
Scott.

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:06 PM
To: Struts Users Mailing List
Subject: Re: Netscape 4.7 & disable fields


A couple of years back i had to get disabled form element behaviour 
working on ns4 and used dynamically gnerated and positioned divs with a 
tranparent image to cover the elements ... But i think its very silly 
and a waste of time.

It quite a lot of dhtml fiddlyness for all 3 ns4 users.. :)

Lunedì, 31 mar 2003, alle 18:19 Europe/Rome, James Mitchell ha scritto:

> On Mon, 2003-03-31 at 11:12, Gus Delgado wrote:
>> Has anyone run with his/her Struts application and Nestcape 4.7. I 
>> have
>> a few textfields that once a button is click the text field go from
>> being enable to disable (read-only) it works great on IE 5.5 and
>> Netscape 6.0 but it seems that Netscape 4.7 does not understand the
>> disable=true attribute.  Any ideas?
>
> Netscape 4.x does not support disabled fields.
> If you must support that browser version, use html:hidden with the 
> write
> option:
>  http://jakarta.apache.org/struts/userGuide/struts-html.html#hidden
>
>>
>> Thanks
>> Gus
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
>
>
>
>
> -
> 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: OnMouseOut

2003-04-01 Thread Niesen, Nathan
I haven't used StrutsMenu so these are just suggestions:

1. Do you have JavaScript enabled?
2. Should "location=javascript:..." be "href=javascript:...", if not in the
tag at least when the html is rendered. You probably don't need the
"javascript:".
3. Is the tag rendering the html event names in all lowercase? It should be,
proper-cased event names are not supported in all browsers.
4. Have you tried with a different web browser?
5. Are you properly delimiting any nested double and single quotes?
6. Try setting onmouseout="alert('mouse out fired');"
7. Is the method you're calling returning true or false? This affects what
the browser does when you click on the link.


 -Original Message-
From:   Raible, Matt [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, April 01, 2003 10:22 AM
To: 'Struts Users Mailing List'
Subject:RE: OnMouseOut

Try the struts-menu user list.  I didn't write this displayer, but I'm
guessing it doesn't support these attributes.

Matt

> -Original Message-
> From: Alessio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 5:33 AM
> To: Struts User
> Subject: OnMouseOut
> 
> 
> Hi, i' ve a problem with StrutsMenu...how use OnMouseOut with
> StrutsMenu? i try in this way:
> 
> 
>location="javascript:document.forms.MyForm.submit()"
> OnMouseOut="...OnMouseOut"  OnMouseOver="...OnMouseOver..."   />
> 
> 
> in this example i use an SimpleMenuDisplayer for render it and an form
> for submit my information...but the OnMouseOver and OnMouseOut don't
> work...whi?
> 
> Thanks in advance.
> Alessio
> 


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



RE: Struts link to map viewer

2003-04-01 Thread Niesen, Nathan
I posted this one:

http://206.144.170.252/cit-framework/citExampleWelcome.jsp


Nathan A. Niesen
Application Developer
ObjectFX Corporation
10 Second St NE, Suite 400
Minneapolis, MN  55413
612-312-2002 x2633
mailto:[EMAIL PROTECTED]
www.objectfx.com


 -Original Message-
From:   Peter Abbot [mailto:[EMAIL PROTECTED] 
Sent:   Monday, March 31, 2003 4:12 PM
To: [EMAIL PROTECTED]
Subject:Struts link to map viewer

Last week someone posted a link to a site that used struts and ArcIMS to
display maps. 
There was an example of a version of the application that was targeted
to the PDA. 

I have searched the archives but cant seem to find it. 
Can whoever sent it, send it again. I would like to show it to my boss
because we are looking at extending our ArcIMS/struts application doing
something similar for PDA's and tablets.

Cheers
Pete

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



RE: how to switch of logging with log4j at initialization

2003-04-01 Thread Niesen, Nathan

If you put the properties files in your webapps classes dir, it will only
apply to your webapp.

Try putting the properties files in your app servers classpath. With Tomcat
you'd put them in tomcat/common/classes.

 -Original Message-
From:   Martin Monsorno [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, April 01, 2003 8:43 AM
To: Niesen, Nathan
Cc: 'Edgar Dollin'; 'Struts Users Mailing List'
Subject:Re: how to switch of logging with log4j at initialization

"Niesen, Nathan" <[EMAIL PROTECTED]> writes:
> There is a bug in commons-logging 1.0.2+ that causes log4j to be used if
> it's found in the classpath.  Just remove the log4j jar from your webapps
> lib dir.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561
>
> There is also a bug in the commons-logging nightly build, which is what
the
> current Struts build uses, that causes the commons-logging.properties to
be
> ignored.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894

As I wrote as an answer to Edgar Dollin, my problem is not that log4j
is used, but that my log4j configuration seems to be not the only one
used, as I set the logging for "com.apache" to a file with ERROR
level, but the output for (some of?) the commons-classes is logged
anyway to stdout.

-- 
Martin

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



RE: [OT] JavaScript Debugger For Client-Side Validation

2003-03-31 Thread Niesen, Nathan
You guys can bash IE all you want but until about 6 months ago IE and
Netscape 4.7 were the only games in town for hard-core DTHML applications.
Being standards compliant is worthless if the standards don't contain the
features you need. Mozilla and Opera finally figured that out and started
providing some real competition. The new wave of browsers (Phoenix 0.5,
Netscape 7.0, and Opera 7.01) will finally have a shot at reducing IE's
market share. I still spend the majority of my time working around bugs and
quirks in the non-IE browsers but gap the is finally shrinking.


 -Original Message-
From:   Dan Allen [mailto:[EMAIL PROTECTED] 
Sent:   Monday, March 31, 2003 12:00 PM
To: Struts Users Mailing List
Subject:Re: [OT] JavaScript Debugger For Client-Side Validation

MOZILLA!  There isn't a person I have introduced to mozilla, both
microsoft lovers and haters alike, that do not swear by mozilla now.
If tab browsing, dom inspector, javascript console or javascript
debugger doesn't catch your interest, then you are just not
interested in software.  Mozilla rocks.  I rest my case.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
[Frodo]: "I wish it need not have happened in my time." 
[Gandalf]: "So do I, and so do all who live to see such times. 
But that is not for them to decide. All we have to decide is 
what we do with the time that is given to us.'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



RE: [OT] Tiles with logic:iterate and JavaScript to sort table

2003-03-31 Thread Niesen, Nathan

Instead of hard coding the entire path, you should use the context path to
get your webapp directory and then specify the path from there.

If you had the following directory structure:

-tomcat
 -webapps
  -myWebapp
   -js
-sortTable.js

You would specify the src attribute like this: src="<%=
request.getContextPath() %>/js/sortTable.js"

The page would be renderer like this: src="/myWebapp/js/sortTable.js"

This makes the page more portable.

 -Original Message-
From:   Thomas CORNET [mailto:[EMAIL PROTECTED] 
Sent:   Monday, March 31, 2003 9:25 AM
To: Struts Users Mailing List
Subject:RE: [OT] Tiles with logic:iterate and JavaScript to sort
table


Sorry, but I don't know JavaScript very well and I don't
understand your remark.

 > My answer was : let the script tags where they are otherwise it won't
work.

In my example the call to the function initTable("table0");
is done after the definition of the table  Yes. See previous answer.

it is probably the JavaScript which is not called.
but I do not know how to make this test.
I added the line alert("function found and starting..");,but nothing
what is the aim of this instruction ?

 >
place the code line like :

function initFunction(arg)
{
alert("function found and starting");
. rest of code
}

the aim of alert() is to display a little popup with text inside. If it 
displays, the javascript is being executed.

if nothing is displaying, the path to the script library isn't good. Try to 
put an absolute path in your page.



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



RE: Tiles with logic:iterate and JavaScript to sort table

2003-03-31 Thread Niesen, Nathan
 
Generally the JS include () should go in
the head of the document so that the objects and/or functions defined in it
will be global to the page. The alert() function just displays a dialog
window with a message. It's like using println() to debug java code.
 
Here are some JavaScript resources:
 
http://developer.netscape.com/docs/manuals/javascript.html
 
http://developer.netscape.com/docs/manuals/communicator/jsref/index.htm
 
http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html
 
 
 
Welcome to the wonderful world of JavaScript!
 
 
-Original Message-
From: Heligon Sandra [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 7:41 AM
To: 'Struts Users Mailing List'
Subject: RE: Tiles with logic:iterate and JavaScript to sort table
 
Sorry, but I don't know JavaScript very well and I don't 
understand your remark. 
In my example the call to the function initTable("table0"); 
is done after the definition of the table http://www.thomson.net/   
Original Message- 
From: Thomas CORNET [ mailto:[EMAIL PROTECTED] 
] 
Sent: 31 March 2003 14:32 
To: Struts Users Mailing List 
Subject: Re: Tiles with logic:iterate and JavaScript to sort table 
 
   As the 'initFunction' function has a parameter which is the name of the 
table, its call should stay at the bottom of the page. If you put it at the 
top, there will be an error because the table hasn't been yet processed by 
the navigator so it can't know its name. To ensure the script is called, 
just put a debugging message at the first line of 'initFunction' in your 
script, such as 
 alert("function found and starting.."); 
 
  Thomas 
At 14:18 31/03/2003, you wrote: 
> I have a Struts web application with the following JSP page that 
>allows to display table. 
> I would like to allow the user to sort column. 
> 
> <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> 
> <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> 
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> 
> 
>  
> 
> cellspacing="0" bordercolor="#FF"> 
> 
> <%-- Title for the columns of the table --%> 
>  
> 

>  
>  
> 
> type="myBean.Employee" offset="offset" length="length"> 
>  
>  
>
>  
>
>  
> 
>  
>
>  
>  
>  
> 
>  
> 
>  
> initTable("table0"); 
>  
> 
> This page extends a common model classicLayout.jsp. 
> Do I have to call the script in the  of the
classicLayout.jsp 
>? 
> 
> I placed the JavaScript file sortTable.js in the same directory as

>my JSP. 
> But it doesn't work, has someone an idea of the problem ? 
> 
> 
> 
>---
- 
> 
>As of February 12th, 2003 Thomson unifies its email addresses on a
worldwide 
>basis. 
>Please note my new email address: [EMAIL PROTECTED] 
> 
> http://www.thomson.net/   
 
- 
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
  


RE: how to switch of logging with log4j at initialization

2003-03-28 Thread Niesen, Nathan

There is a bug in commons-logging 1.0.2+ that causes log4j to be used if
it's found in the classpath.  Just remove the log4j jar from your webapps
lib dir.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561

There is also a bug in the commons-logging nightly build, which is what the
current Struts build uses, that causes the commons-logging.properties to be
ignored.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894

Nathan.

 -Original Message-
From:   Edgar Dollin [mailto:[EMAIL PROTECTED] 
Sent:   Friday, March 28, 2003 7:39 AM
To: 'Martin Monsorno'; 'Struts Users Mailing List'
Subject:RE: how to switch of logging with log4j at initialization

In commons-logging.properties (somewhere on the classpath) I have these two
lines


org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory
Log

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF
actory

I forget what they are both for but commons-logging always seems to find the
log4j configuration.

Edgar

> -Original Message-
> From: Martin Monsorno [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 28, 2003 3:04 AM
> To: 'Struts Users Mailing List'
> Subject: Re: how to switch of logging with log4j at initialization
> 
> 
> COMPAGNON GUILLAUME <[EMAIL PROTECTED]> writes:
> 
> > according to me (as the simplest way), you need to have a 
> > commons-logging.propeties file with 
> > 
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.
> > Log4jF
> > actory
> 
> I tried this already, but it doesn't change anything.
> 
> Apparently, log4j is already used by Struts, but my 
> configuration is ignored.  Like there is an appender 
> configured in the java code, or so.  But I hope, this is not 
> the case ?
> 
> 
> -- 
> Martin
> 

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



RE: Configuring Tiles + Validation + Modules

2003-03-27 Thread Niesen, Nathan
My mistake on the lack user manual, I forgot about the PDF and the JavaWorld
article links on the docs page. My real beef is that they are not just
included as part of the Struts download.

 -Original Message-
From:   Niesen, Nathan  
Sent:   Thursday, March 27, 2003 1:17 PM
To: 'Cedric Dumoulin'; Struts Users Mailing List
Subject:RE: Configuring Tiles + Validation + Modules

I also wanted to mention... If I can only accomplish this using tiles, then
that indicates to me that something is wrong with the way modules were
designed.  I also noticed in the tiles examples that many of your URLs
contain <%=request.getContextPath()%>. This looks to me like you are
constantly having to override the URLs generated by the modules. I see that
as another design issue.

I admit I haven't fully explored the tiles-documentation.war but I do have
the following comments. The docs module lacks any documentation on how to
actually use tiles. Instead it is just a list of features and release notes
and is in fact identical to the welcome page. I think a user manual with
similar format and content to David Geary's templates article (Using JSP
templates to encapsulate Webpage layout and encourage modular design) would
be extremely beneficial. The left hand navigation on the main page is not
organized very well, it contains duplicate links with deferent names and
listed under different categories. The examples also contain a lot of script
which makes them hard to read. The blocks of script in the layouts (column,
vertical, etc...) and menu.jsp look like potential candidates for custom
tags.

Nathan.


 -Original Message-----
From:   Niesen, Nathan  
Sent:   Thursday, March 27, 2003 12:32 PM
To: 'Cedric Dumoulin'; Struts Users Mailing List
Subject:RE: Configuring Tiles + Validation + Modules

Again, all that example appears to show is that you can link from one module
to another. As far as I can tell, it does not show how to define a jsp page
containing a Struts  tag in on module and then
reuse that page from modules B, C, and D. The action mappings for myAction
would need to be defined in the config files for modules B, C, and D because
the forward pages would be different.

Here's as good an example as any that I can give in this medium:

/mapping/zoomControl.jsp
...

  

  

...

/orders-module/orderTracking.jsp
...

  
  ...order selection and action controls...

...

/inventory-module/inventoryTracking.jsp
...

  ...product selection control...
  

...

/WEB-INF/struts-config-inventory-module.xml
  ...
  

  
  ...

/WEB-INF/struts-config-orders-module.xml
  ...
  

  
  ...


 -Original Message-
From:   Cedric Dumoulin [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, March 27, 2003 10:11 AM
To: Struts Users Mailing List
Subject:Re: Configuring Tiles + Validation + Modules



Niesen, Nathan wrote:

>I basically have the same questions. I've been searching the user docs and
>mailing lists trying to get a handle on what modules were intended to do,
>what modules can and can't do, and how I can use modules to improve my
>application framework. It appears to me that the modules feature opened up
a
>whole can-o-design-worms and they're still wiggling. I can't find anything
>that clearly defines intended usage of modules or the limitations of
>modules; especially in regards to using "resources" outside of a modules
>sub-directory.
>
>In addition to John's questions, I have the following question:
>
>1) How can I use tiles/templates to assemble a page in one module from
>reusable "components/pages" in one or more other modules? For example: I
>have pages in modules B, C, and D, that all want to pull in a menu page
from
>my default module as well as a reusable page from module A.
>  
>
  Tiles config file consider the url as absolute to the application. So, 
simply specify the absolute URL of your layout, page or tile.
  The tiles-documentation.war use 3 modules. You can check it for examples.

  Cedric

>Other issues with modules:
>
>1) Not all tags (html:img in particular) use the pagePattern or
>forwardPattern attributes from the controller. If I want to use an image in
>my header.jsp, the image file has to be physically located in each module
or
>I get a broken link.
>
>2) The pagePattern and forwardPattern are defined on the controller which
>means all tag or forward URLs for the module will be mapped to the same
>context relative URL. I think it would be more flexible if you simply
>specified the pattern as part of the URL attribute for the tag or forward.
>For example: page="$P/header.gif"/> and 
>
>3) The examples don't effectively demonstrate the effects that the
>contextRelative, input

RE: Configuring Tiles + Validation + Modules

2003-03-27 Thread Niesen, Nathan
I also wanted to mention... If I can only accomplish this using tiles, then
that indicates to me that something is wrong with the way modules were
designed.  I also noticed in the tiles examples that many of your URLs
contain <%=request.getContextPath()%>. This looks to me like you are
constantly having to override the URLs generated by the modules. I see that
as another design issue.

I admit I haven't fully explored the tiles-documentation.war but I do have
the following comments. The docs module lacks any documentation on how to
actually use tiles. Instead it is just a list of features and release notes
and is in fact identical to the welcome page. I think a user manual with
similar format and content to David Geary's templates article (Using JSP
templates to encapsulate Webpage layout and encourage modular design) would
be extremely beneficial. The left hand navigation on the main page is not
organized very well, it contains duplicate links with deferent names and
listed under different categories. The examples also contain a lot of script
which makes them hard to read. The blocks of script in the layouts (column,
vertical, etc...) and menu.jsp look like potential candidates for custom
tags.

Nathan.


 -Original Message-
From:   Niesen, Nathan  
Sent:   Thursday, March 27, 2003 12:32 PM
To: 'Cedric Dumoulin'; Struts Users Mailing List
Subject:RE: Configuring Tiles + Validation + Modules

Again, all that example appears to show is that you can link from one module
to another. As far as I can tell, it does not show how to define a jsp page
containing a Struts  tag in on module and then
reuse that page from modules B, C, and D. The action mappings for myAction
would need to be defined in the config files for modules B, C, and D because
the forward pages would be different.

Here's as good an example as any that I can give in this medium:

/mapping/zoomControl.jsp
...

  

  

...

/orders-module/orderTracking.jsp
...

  
  ...order selection and action controls...

...

/inventory-module/inventoryTracking.jsp
...

  ...product selection control...
  

...

/WEB-INF/struts-config-inventory-module.xml
  ...
  

  
  ...

/WEB-INF/struts-config-orders-module.xml
  ...
  

  
  ...


 -Original Message-
From:   Cedric Dumoulin [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, March 27, 2003 10:11 AM
To: Struts Users Mailing List
Subject:Re: Configuring Tiles + Validation + Modules



Niesen, Nathan wrote:

>I basically have the same questions. I've been searching the user docs and
>mailing lists trying to get a handle on what modules were intended to do,
>what modules can and can't do, and how I can use modules to improve my
>application framework. It appears to me that the modules feature opened up
a
>whole can-o-design-worms and they're still wiggling. I can't find anything
>that clearly defines intended usage of modules or the limitations of
>modules; especially in regards to using "resources" outside of a modules
>sub-directory.
>
>In addition to John's questions, I have the following question:
>
>1) How can I use tiles/templates to assemble a page in one module from
>reusable "components/pages" in one or more other modules? For example: I
>have pages in modules B, C, and D, that all want to pull in a menu page
from
>my default module as well as a reusable page from module A.
>  
>
  Tiles config file consider the url as absolute to the application. So, 
simply specify the absolute URL of your layout, page or tile.
  The tiles-documentation.war use 3 modules. You can check it for examples.

  Cedric

>Other issues with modules:
>
>1) Not all tags (html:img in particular) use the pagePattern or
>forwardPattern attributes from the controller. If I want to use an image in
>my header.jsp, the image file has to be physically located in each module
or
>I get a broken link.
>
>2) The pagePattern and forwardPattern are defined on the controller which
>means all tag or forward URLs for the module will be mapped to the same
>context relative URL. I think it would be more flexible if you simply
>specified the pattern as part of the URL attribute for the tag or forward.
>For example: page="$P/header.gif"/> and 
>
>3) The examples don't effectively demonstrate the effects that the
>contextRelative, inputForward, pagePattern, and forwardPattern attributes
>have on the page, forward, action, and href attributes.
>
>4) The examples only show how to switch from one self-contained module to
>another. They don't demonstrate how to combine resources/pages from
multiple
>modules into a single page via either includes or tiles/templates.
>
>Thanks, Nathan.
>
> -Original Message

RE: Configuring Tiles + Validation + Modules

2003-03-27 Thread Niesen, Nathan
Again, all that example appears to show is that you can link from one module
to another. As far as I can tell, it does not show how to define a jsp page
containing a Struts  tag in on module and then
reuse that page from modules B, C, and D. The action mappings for myAction
would need to be defined in the config files for modules B, C, and D because
the forward pages would be different.

Here's as good an example as any that I can give in this medium:

/mapping/zoomControl.jsp
...

  

  

...

/orders-module/orderTracking.jsp
...

  
  ...order selection and action controls...

...

/inventory-module/inventoryTracking.jsp
...

  ...product selection control...
  

...

/WEB-INF/struts-config-inventory-module.xml
  ...
  

  
  ...

/WEB-INF/struts-config-orders-module.xml
  ...
  

  
  ...


 -Original Message-
From:   Cedric Dumoulin [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, March 27, 2003 10:11 AM
To: Struts Users Mailing List
Subject:Re: Configuring Tiles + Validation + Modules



Niesen, Nathan wrote:

>I basically have the same questions. I've been searching the user docs and
>mailing lists trying to get a handle on what modules were intended to do,
>what modules can and can't do, and how I can use modules to improve my
>application framework. It appears to me that the modules feature opened up
a
>whole can-o-design-worms and they're still wiggling. I can't find anything
>that clearly defines intended usage of modules or the limitations of
>modules; especially in regards to using "resources" outside of a modules
>sub-directory.
>
>In addition to John's questions, I have the following question:
>
>1) How can I use tiles/templates to assemble a page in one module from
>reusable "components/pages" in one or more other modules? For example: I
>have pages in modules B, C, and D, that all want to pull in a menu page
from
>my default module as well as a reusable page from module A.
>  
>
  Tiles config file consider the url as absolute to the application. So, 
simply specify the absolute URL of your layout, page or tile.
  The tiles-documentation.war use 3 modules. You can check it for examples.

  Cedric

>Other issues with modules:
>
>1) Not all tags (html:img in particular) use the pagePattern or
>forwardPattern attributes from the controller. If I want to use an image in
>my header.jsp, the image file has to be physically located in each module
or
>I get a broken link.
>
>2) The pagePattern and forwardPattern are defined on the controller which
>means all tag or forward URLs for the module will be mapped to the same
>context relative URL. I think it would be more flexible if you simply
>specified the pattern as part of the URL attribute for the tag or forward.
>For example: page="$P/header.gif"/> and 
>
>3) The examples don't effectively demonstrate the effects that the
>contextRelative, inputForward, pagePattern, and forwardPattern attributes
>have on the page, forward, action, and href attributes.
>
>4) The examples only show how to switch from one self-contained module to
>another. They don't demonstrate how to combine resources/pages from
multiple
>modules into a single page via either includes or tiles/templates.
>
>Thanks, Nathan.
>
> -Original Message-
>From:  Hohlen, John C [mailto:[EMAIL PROTECTED] 
>Sent:  Wednesday, March 26, 2003 8:20 AM
>To:Struts-User (E-mail)
>Subject:   Configuring Tiles + Validation + Modules
>
>I'm looking for some help on how to configure the Tiles and Validation
>Plug-Ins.  A lot of the good books (Struts In Action, Programming Jakarta
>Struts, etc.) and replies to the mailing list address these topics
>independently, but not collectively.  In addition, I took a look at James
>Holmes "Switching Modules" example, but that focuses on the different ways
>to switch b/t modules, not on how to configure Modules with Tiles and the
>Validation frameworks. 
>
>For discussion purposes, let's assume I have following 3 modules (default,
>modA, modB).  Here are my questions:
>
>1) If I have a form bean definition used by all 3 modules, does it need to
>be defined in each of the 3 struts-config files, or can I just declare it
in
>the default struts-config?
>
>2) Does each modules' struts-config file need the following declaration to
>use the Validation framework, or can I simply declare this once in the
>config file for the default module?
>
>  
>  value="/WEB-INF/validator-rules.xml,
>/WEB-INF/validation.xml"/>
>  
>
>3) For Tile Definition config files, can all of these just be declared in
>the default str

RE: Configuring Tiles + Validation + Modules

2003-03-27 Thread Niesen, Nathan
  String suffix = request.getParameter("forwardSuffix");

  if (suffix == null) {
 try {
// look for a previous forward suffix stored in the session
suffix =
(String)request.getSession().getAttribute("forwardSuffix");
 } catch (Exception e) {
log.error("MyActionBase.getActionForward an exception has
occured: ", e);
 }
  }

  String forwardName = name;
  if (suffix != null) {
 forwardName = forwardName + suffix;
  }

  if (log.isDebugEnabled()) {
 log.debug("MyActionBase.getActionForward for action: " +
mapping.getPath()
   + "  forwardName: " + forwardName);
  }

  // Although not publicly known or advertised, the logic below allows
action
  // forwards to be dynamically overridden. For example, if you
specified a url
  // like "myAction.do?success=nextAction.do", you could override
  // the default behavior for succes as defined in the struts action
mapping.
  String forward = request.getParameter(forwardName);

  if (forward == null) {
 return mapping.findForward(forwardName);
  } else {
 return new ActionForward(forward);
  }

   }
...

I hope this is useful.

Thanks, Nathan.

Nathan A. Niesen
Application Developer
ObjectFX Corporation
10 Second St NE, Suite 400
Minneapolis, MN  55413
612-312-2002 x2633
mailto:[EMAIL PROTECTED]
www.objectfx.com



-Original Message-
From: Hohlen, John C [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 8:04 PM
To: Struts Users Mailing List; Struts-User (E-mail); Hohlen, John C; Niesen,
Nathan
Subject: RE: Configuring Tiles + Validation + Modules

Nathan,

For now, I think we're going to just use the multiple config file
options (new in B3).  I was able to bust up our ONE struts-config.xml file
and get this working in just 1/2 day (it would have been less if I wouldn't
have introduced some XML syntax errors in my new config files).   In
addition, we'll probably bust up our application resource file and merge
them back together during our ANT build process.  We have a team of about 12
developers, so these files have become a real bottleneck.  This approach
seems to achieve many of the same benefits as modules, without all the
additional technical headaches (although you need to guard against duplicate
action mappings, form bean definitions, keys/values across all the
collection of files).

JOHN

-Original Message-
From: Niesen, Nathan [mailto:[EMAIL PROTECTED]
Sent: Wed 3/26/2003 4:43 PM [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
To: Struts-User (E-mail)
Cc:
Subject: RE: Configuring Tiles + Validation + Modules




I basically have the same questions. I've been searching the user docs and
mailing lists trying to get a handle on what modules were intended to do,
what modules can and can't do, and how I can use modules to improve my
application framework. It appears to me that the modules feature opened up a

whole can-o-design-worms and they're still wiggling. I can't find anything
that clearly defines intended usage of modules or the limitations of
modules; especially in regards to using "resources" outside of a modules
sub-directory.

In addition to John's questions, I have the following question:

1) How can I use tiles/templates to assemble a page in one module from
reusable "components/pages" in one or more other modules? For example: I
have pages in modules B, C, and D, that all want to pull in a menu page from

my default module as well as a reusable page from module A.

Other issues with modules:

1) Not all tags (html:img in particular) use the pagePattern or
forwardPattern attributes from the controller. If I want to use an image in
my header.jsp, the image file has to be physically located in each module or

I get a broken link.

2) The pagePattern and forwardPattern are defined on the controller which
means all tag or forward URLs for the module will be mapped to the same
context relative URL. I think it would be more flexible if you simply
specified the pattern as part of the URL attribute for the tag or forward.
For example:  and 

3) The examples don't effectively demonstrate the effects that the
contextRelative, inputForward, pagePattern, and forwardPattern attributes
have on the page, forward, action, and href attributes.

4) The examples only show how to switch from one self-contained module to
another. They don't demonstrate how to combine resources/pages from multiple

modules into a single page via either includes or tiles/templates.

Thanks, Nathan.

 -Original Message-
From:   Hohlen, John C [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent:   Wednesday, March 26, 2003 8:20 AM
To: Struts-User (E-mail)
Subject:Configuring Tiles + Validation + Modules

I'm looking for some

RE: Configuring Tiles + Validation + Modules

2003-03-26 Thread Niesen, Nathan

I basically have the same questions. I've been searching the user docs and
mailing lists trying to get a handle on what modules were intended to do,
what modules can and can't do, and how I can use modules to improve my
application framework. It appears to me that the modules feature opened up a
whole can-o-design-worms and they're still wiggling. I can't find anything
that clearly defines intended usage of modules or the limitations of
modules; especially in regards to using "resources" outside of a modules
sub-directory.

In addition to John's questions, I have the following question:

1) How can I use tiles/templates to assemble a page in one module from
reusable "components/pages" in one or more other modules? For example: I
have pages in modules B, C, and D, that all want to pull in a menu page from
my default module as well as a reusable page from module A.

Other issues with modules:

1) Not all tags (html:img in particular) use the pagePattern or
forwardPattern attributes from the controller. If I want to use an image in
my header.jsp, the image file has to be physically located in each module or
I get a broken link.

2) The pagePattern and forwardPattern are defined on the controller which
means all tag or forward URLs for the module will be mapped to the same
context relative URL. I think it would be more flexible if you simply
specified the pattern as part of the URL attribute for the tag or forward.
For example:  and 

3) The examples don't effectively demonstrate the effects that the
contextRelative, inputForward, pagePattern, and forwardPattern attributes
have on the page, forward, action, and href attributes.

4) The examples only show how to switch from one self-contained module to
another. They don't demonstrate how to combine resources/pages from multiple
modules into a single page via either includes or tiles/templates.

Thanks, Nathan.

 -Original Message-
From:   Hohlen, John C [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, March 26, 2003 8:20 AM
To: Struts-User (E-mail)
Subject:Configuring Tiles + Validation + Modules

I'm looking for some help on how to configure the Tiles and Validation
Plug-Ins.  A lot of the good books (Struts In Action, Programming Jakarta
Struts, etc.) and replies to the mailing list address these topics
independently, but not collectively.  In addition, I took a look at James
Holmes "Switching Modules" example, but that focuses on the different ways
to switch b/t modules, not on how to configure Modules with Tiles and the
Validation frameworks. 

For discussion purposes, let's assume I have following 3 modules (default,
modA, modB).  Here are my questions:

1) If I have a form bean definition used by all 3 modules, does it need to
be defined in each of the 3 struts-config files, or can I just declare it in
the default struts-config?

2) Does each modules' struts-config file need the following declaration to
use the Validation framework, or can I simply declare this once in the
config file for the default module?

  

  

3) For Tile Definition config files, can all of these just be declared in
the default struts-config, or should they be declared in the module
struts-config they correspond to (assuming you've divided your Tile
definitions by module)?  For example:

  

  

4) Can I use the default module's application resource file for text common
across modules?  Therefore, preventing me from having to duplicate entries
across modules.  If so, this means Struts always looks in the particular
module's application resource first, then the default module.  But this
doesn't apply for form bean definitions or action mappings, correct?

5) Is the following an acceptable way to configure the application resource
files:

 --- struts-config.xml (default) ---
 

 --- struts-config-modA.xml (default) ---
 

 --- struts-config-modB.xml (default) ---
 

Thanks in advance for your help,

JOHN


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



RE: Returning a different request-type (xml/pdf/doc/etc...) through Struts

2003-03-26 Thread Niesen, Nathan

We do a similar thing to return map images in gif and png format:

Action mapping (note, no forward):





MapImageAction:

  // Make sure images are not cached on client or
  // else panning/zooming will not go get a new image.
  // These values ARE case sensitive and must be exactly as below:
  response.setHeader("Pragma", "No-cache");
  response.setHeader("Cache-Control", "no-cache");
  response.setDateHeader("Expires", 1);

  response.setContentType(contentType);
  ServletOutputStream os = response.getOutputStream();
  os.write(imageBytes, 0, imageBytes.length);
  os.flush();
  os.close();

  // Do not forward this request as we have already sent the bytes back
  // to the client.
  return null;
  // I tried having a jsp page return the image bytes, but this
  // resulted in a JSP "IllegalStateException".

JSP Page:
...

...

Nathan.

 -Original Message-
From:   Jeremy Nix [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, March 26, 2003 8:58 AM
To: [EMAIL PROTECTED]
Subject:Returning a different request-type (xml/pdf/doc/etc...)
through Struts

I am new to struts, and have just recently began porting our current web
application over to the struts framework.  A piece of our application
involves creating a pdf file and displaying it to the user.  Currently,
in the old framework, we set the ContextType of the response, and write
the byte content to the response's oputputstream, which will render the
pdf document in the browser.  I know I have direct access to the
response under Struts, but I wanted to see if there was a better
(cleaner) implementation within the struts framework that I may utilize.

Here's a snippet of what I'm doing:
---
response.setContentLength(doc.getContent().length);
response.setContentType(doc.getMimeType().toString());
response.getOutputStream().write(doc.getContent());
return new ActionForward();
---

I've noticed that I get a NullPointer exception after the return
statement on "some" requests.  I'm really unsure of why this is
happening as well.

Stack trace:
java.lang.NullPointerException at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr
ocessor.java:437) at
org.apache.struts.action.RequestProcessor.processActionForward(RequestPr
ocessor.java:401) at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
279) at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

_
Jeremy Nix
Senior Application Developer
Southwest Financial Ltd.
[EMAIL PROTECTED]
(513) 621-6699 ext 1158


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



RE: [FRIDAY] List of sites using Struts

2003-03-14 Thread Niesen, Nathan
SpatialFX Web Application Framework:
http://206.144.170.252/cit-framework/citExampleWelcome.jsp

This site is listed as SpatialFX on the Powered by Struts page but the link
is out of date.  One problem with the Powered by page is figuring out who to
contact to add/update a listing.

Thanks, Nathan.


Nathan A. Niesen
Application Developer
ObjectFX Corporation
www.objectfx.com


 -Original Message-
From:   Chappell, Simon P [mailto:[EMAIL PROTECTED] 
Sent:   Friday, March 14, 2003 8:47 AM
To: Struts Users Mailing List
Subject:RE: [FRIDAY] List of sites using Struts

Yes. There were rumours that it was out of date. So I followed standard
Slashdot procedure and didn't bother checking before putting my own list
together. :-)

Simon

>-Original Message-
>From: Robert McIntosh [mailto:[EMAIL PROTECTED]
>Sent: Friday, March 14, 2003 8:44 AM
>To: Struts Users Mailing List
>Subject: Re: [FRIDAY] List of sites using Struts
>
>
>Is this meant to be what is in addition to what is found here:
>http://jakarta.apache.org/struts/resources/powered.html
>
>?
>Just curious...
>~Robert
>
>Chappell, Simon P wrote:
>
>>After the interesting exchange the other day, I went back 
>through the emails and composed a list of sites that use 
>Struts. This list can be found on my website and I offer it 
>here for your consideration and abuse (mostly from Mark and 
>former Lisp programmers I expect! :-)
>>
>>http://simonpeter.com/techie/java/struts/sites.html
>>
>>Feel free to suggest other sites that you know of.
>>
>>Simon
>>
>>-
>>Simon P. Chappell [EMAIL PROTECTED]
>>Java Programming Specialist  www.landsend.com
>>Lands' End, Inc.   (608) 935-4526
>>
>>-
>>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]



unwanted emty lines in produced html

2003-03-13 Thread Niesen, Nathan

IMHO, if a line only contains jsp tags, comments, or scriptlets that produce
no output then no blank line should be present in the output.

I find it especially annoying that multi-line comments generate a carriage
return for every line of the comment. Those carriage returns are part of the
comment and should be gobbled up. My guess is that this is a JSP compiler or
servlet container issue.



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