Access Struts objects from a session listener

2004-07-21 Thread Ephemeris Lappis
I need to access some Struts objects, like forward mappings, from a session
listener, or other part of the application's code where no request is
available. Is it possible, and, if it is, what is the best way to do it ?
I found in the ServletContext attributes an object of type
org.struts.action.ForwardMappings that may be interesting, but this class
doesn't appear in the API documentation. Is it a private type ?
Thanks for your help.


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



jsf-developers -- new Yahoo group

2004-07-21 Thread Oswald Campesato
Hello:

Since I didn't find any groups specifically devoted to
JSF, today I took the plunge and created a new Yahoo 
group (details below).

Though the primary focus of the group is JSF-related 
questions, initially I would expect that there will 
also be significant overlap with Struts-related
topics,
such as migrating from Struts to JSF (which probably
comprises almost everyone:)

I'm inviting everyone to join, and I hope that this
group will assist not only the people who want to
learn 
"pure" JSF, but also those people (including moi) who 
want to learn the details of making a "transition"
from Struts to JSF

ttfn,

Oswald

The group information
-
group name: jsf-developers 
home page:
http://groups.yahoo.com/group/jsf-developers 
email address: [EMAIL PROTECTED] 


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



About Struts + JBoss preference issue

2004-07-21 Thread Koon Yue Lam
Hi ! My application has change from Struts + Tomcat to Struts + Jboss 3.X

I create various struts Actions to deal with incoming request, in the
Action class, it preform remote lookup of session bean's home
interface and create, destory ... it.

My session bean has an DAO attach to it to preform database related stuffs
NO entiy beans in my application since transaction is not a problem
and most DB query are read only

The question is the speed, it is much slower when I request an Action
instead of directly request a servlet. Is it normal ? I don't mind a
little bit preformance tradeoff but I want to know the delay is caused
by Struts or something else.

Any help?

Regards

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



Re: Velocity vs tags (was JSF vs Struts)

2004-07-21 Thread Rick Reumann
David Evans wrote:
Could you elaborate on what you find distastful about Velocity? 
I wasn't being "all" seriously when I said "yuk":) but seriously I do 
find that when you have a decent amount of conditional logic on a page 
(which sometimes during presentation is unavoidable if you want to 
re-use a page/template), I think JSTL  constructs 
look cleaner. Mind you, "bad" JSP with a bunch of scriplets is horrible, 
but JSP 2.0 and JSTL looks pretty sweat. More of a matter of preference 
though I guess.

Actually a bunch of us get in this debate a lot and it would be 
interesting to see a "code off" challenge of two views (JSP vs Velocity) 
done to best standards and dealing with a fairly complex presentation. 
Usually the examples you see either bastardize one or the other and 
don't treat the opposing view fairly.

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


Re: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Peng Tuck Kwok
How about running the samples that come with struts (struts-example)?
They use a resource bundle and if there is a issue as you described,
then certainly the text wouldn't be able to be display the text. Try
it , better yet maybe you can send the war file to me, I'll see if I
can spot anything for you.

On Wed, 21 Jul 2004 12:25:49 -0400, Kris Schneider <[EMAIL PROTECTED]> wrote:
> Huh. Here's a test with TC 5.0.27, JDK 1.4.2_05, and WinXP:
> 
> loadProps.jsp:
> --
> <%@ page contentType="text/plain" %>
> <%@ page import="java.io.*" %>
> <%@ page import="java.util.*" %>
> <%
> String fileName = "foo.properties";
> ClassLoader cl = Thread.currentThread().getContextClassLoader();
> InputStream in = cl.getResourceAsStream(fileName);
> Properties props = new Properties();
> props.load(in);
> out.print(props);
> %>
> 
> With "foo.properties" located in WEB-INF/classes, the page outputs:
> 
> {A=1, C=3, B=2}
> 
> Have you done anything to TC like create a custom Context for the app? Are you
> sure target.getConfigurationName() is really returning what you expect (e.g. no
> leading spaces, etc.)?
> 
> Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> 
> > Yep, exactly
> >
> >
> > > -Ursprüngliche Nachricht-
> > > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > > Gesendet: Mittwoch, 21. Juli 2004 17:30
> > > An: Struts Users Mailing List
> > > Betreff: Re: AW: AW: OT: Problems with classpath under tomcat 5
> > >
> > > Does "filename" evaluate to something like "foo.properties" (no other path
> > > info)
> > > and is that file located in WEB-INF/classes?
> > >
> > > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > >
> > > > Thanx, but it doesn't work either.
> > > >
> > > > > -Ursprüngliche Nachricht-
> > > > > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > > > > Gesendet: Mittwoch, 21. Juli 2004 16:54
> > > > > An: Struts Users Mailing List
> > > > > Betreff: Re: AW: OT: Problems with classpath under tomcat 5
> > > > >
> > > > > ..
> > > > > String fileName = target.getConfigurationName() + ".properties";
> > > > > ClassLoader cl = Thread.currentThread().getContextClassLoader();
> > > > > InputStream in = cl.getResourceAsStream(fileName);
> > > > > Properties props = new Properties();
> > > > > props.load(in);
> > > > > ..
> > > > >
> > > > > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > > > >
> > > > > >
> > > > > >
> > > > > > > -Ursprüngliche Nachricht-
> > > > > > > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > > > > > > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > > > > > > An: Struts Users Mailing List
> > > > > > > Betreff: Re: OT: Problems with classpath under tomcat 5
> > > > > > >
> > > > > > > Are you sure if it is not looking your properties file in the
> > > > > > > classpath of the webapp ?
> > > > > >
> > > > > > Yes, because it would find them there.
> > > > > >
> > > > > > > When you say everything works fine until tomcat 5 is used , does
> > > the
> > > > > > > console print out any error ? Also how do you know it is searching
> > > in
> > > > > > > shared classes ?
> > > > > >
> > > > > > Yes, the console prints out our debug output:
> > > > > >
> > > > > > xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> > > > > >
> > > > > > if you read the code, you'll find that it's also trying to locate
> > > the
> > > > > '.'
> > > > > > directory. In all other environments it's webapps/mywebapp/WEB-
> > > > > INF/classes
> > > > > > in tomcat5 it's .../common/classes (which is one of the pathes
> > > according
> > > > > to
> > > > > > tomcat5 class loader faq). (Sorry, I wrote shared/classes in my
> > > first
> > > > > mail,
> > > > > > it was common/classes, but it doesn't really matter, because both
> > > aren't
> > > > > the
> > > > > > right ones :-)
> > > > > >
> > > > > > Regards
> > > > > > Leon
> 
> 
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > > > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > it's a bit OT but maybe some of you had a similar problem
> > > shortly
> > > > > and
> > > > > > > > can help.
> > > > > > > >
> > > > > > > > We have a configuration component which configures other
> > > components
> > > > > of
> > > > > > > > the application out of property files. The property files lies
> > > in
> > > > > the
> > > > > > > > 'classes' directory of the application. Everything works fine
> > > until
> > > > > we
> > > > > > > > use tomcat 5 (5.0.19).
> > > > > > > >
> > > > > > > > In tomcat 5 the ClassLoader doesn't search for our property
> > > files in
> > > > > > > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > > > > > > shared/classes which imho should be done after the private
> > > webapp
> > > > > > > > classpath has bin searched through.
> > > > > > > >
> > > > > > > > As I said before it works fine with standalone applications and
> > > with
> > > > > > > > resin.
> > > > > > > >
> > 

Re: struts1.1 validation in nested tag elements

2004-07-21 Thread Bharathiraja
In our project in a place we  have to set   multiple properties .with the
help of nested iterate tag  it has been set.But when we want to provide
validation for those fields it become very hard.
- Original Message - 
From: "Juan Alvarado" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 22, 2004 3:20 AM
Subject: Re: struts1.1 validation in nested tag elements


> Well for one you could explain what the exact problem you are having is.
Looking in the mail archive is also a place to start.
>
> Bharathiraja <[EMAIL PROTECTED]> wrote:Hi,
> i am struggling to do validation (server side and client side) using
struts1.1 VALIDATOR in the NESTED TAG elements.please give me a suggestion
to overcome this problem.
>
> regards,
> Bharathiraja.T
>
>
> -
> Do you Yahoo!?
> Vote for the stars of Yahoo!'s next ad campaign!




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



Re[2]: character encoding

2004-07-21 Thread Carl-Eric Menzel
> I have added an acceptCharset attribute to the FormTag.

> Should be available in the next nightly build - 22/07/2004

Hooray :) Thanks a lot, this is going to be very useful.

Carl-Eric
-- 
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.


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



Re: character encoding

2004-07-21 Thread Niall Pemberton
I have added an acceptCharset attribute to the FormTag.



which will generate something as



Should be available in the next nightly build - 22/07/2004

Niall

- Original Message - 
From: "Carl-Eric Menzel (bitFORCE media)" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Cc: "Larry Young" <[EMAIL PROTECTED]>
Sent: Wednesday, July 21, 2004 8:36 PM
Subject: Re[2]: character encoding


> > Carl-Eric,
>
> >  Yes, I tried the charset on the form but found it didn't do any
good.
>
> >  But what do you force the Encoding to in your Filter?  How can
you
> > know with any certitude how the browser encoded the data values before
> > sending it to you??  It probably works well if the browser is setup to
> > "auto-select" the encoding, but what do you do if they have it
explicitly
> > set to something other than what you are assuming?
>
> Then I'm out of luck. That's the biggest problem with Strut's lack of
> support for the accept-charset attribute. *Most of the time* it works
> that if you send the response in UTF-8 the next request will come in
> as UTF-8 too. That's what I'm doing now - I send out only UTF-8 forms
> and assume that I get the same back. It's an ugly hack, but the only
> way that seems to work at the moment.
>
> I asked a few weeks ago if there was any way for me to extend the form
> tag to support this attribute, or whether there is any good reason why
> it is not implemented. So far I haven't received an answer.
>
> Carl-Eric
> -- 
> Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
> Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
> Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
> Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.
>
>
> -
> 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: struts1.1 validation in nested tag elements

2004-07-21 Thread Juan Alvarado
Well for one you could explain what the exact problem you are having is. Looking in 
the mail archive is also a place to start.

Bharathiraja <[EMAIL PROTECTED]> wrote:Hi,
i am struggling to do validation (server side and client side) using struts1.1 
VALIDATOR in the NESTED TAG elements.please give me a suggestion to overcome this 
problem.

regards,
Bharathiraja.T


-
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

struts1.1 validation in nested tag elements

2004-07-21 Thread Bharathiraja
Hi,
  i am struggling to do validation (server side and client side) using struts1.1 
VALIDATOR  in the NESTED TAG elements.please give me a suggestion to overcome this 
problem.

regards,
Bharathiraja.T

Reloading Application.resources (Again)

2004-07-21 Thread Doug
Yes, I know this has been asked before, and I know it's not a base 
capability.  However, someone posted this solution several months ago, 
which seems reasonable to me.  Can anyone comment on whether there's any 
reason not to use this approach?



MessageResourcesFactory factory =
MessageResourcesFactory.createFactory();
MessageResources resources =
factoryObject.createResources(nameOfMessage);
ServletContext ctx = getServlet().getServletContext();
ctx.setAttribute(Globals.MESSAGES_KEY, resources);

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


Re: App scoped bean to be used with html:optionsCollection in JSP

2004-07-21 Thread Kevin McAbee

property="list"/>


 was indeed 
the fix.  Thank you Jim, you rock.  What I don't understand is that I 
thought I had tried that before as well and that it had screamed about 
not finding the bean in any scope.  I must have been giving the wrong 
bean name - who cares?!

Thanks again,
Kevin


On Jul 21, 2004, at 3:01 PM, Jim Barrows wrote:


-Original Message-
From: Kevin McAbee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 12:47 PM
To: Struts Users Mailing List
Subject: App scoped bean to be used with html:optionsCollection in JSP
As for thorough flamings... I like my meat medium rare :)

// msgres is a MessageResources object
// sc is the ServletContext object
String statesList = msgres.getMessage("list.states");
statesNew = LabelValueListBean.populate(sc.getRealPath(statesList));
sc.setAttribute("statesNew", statesNew);
// I now print out the LabelValueListBean
System.out.println(statesNew.toString());
looks good.

I have tried various methods, all of which failed, of accessing the
LabelValueListBean object in a JSP page via tag libraries for use in
html:optionsCollection and the like.
Attempts:
( is the Jakarta application tag library)

   
  
   
I think that html:optionsCollection will search up the scope to 
application scope to find statesNew.
I would check the java code and make sure that there is a getList for 
statesNew, then try and get rid of the app:attributes and see if that 
helps.



The above returns the following:
javax.servlet.ServletException: No getter method for property list of
bean statesTest

In my desperation:

   This translates rougly to applicationScope.getStatesNew()
property="list"/>


javax.servlet.ServletException: Cannot find bean Label: Alabama ---
Value: AL
Label: Alaska --- Value: AK
Label: Arizona --- Value: AZ
... (the rest of the toString() of LabelValueListBean)

What am I doing wrong?  How can I fix this?  I am going about this a
totally wrong way?  I figure the solution is probably quite
simple and
under my foolish nose.  Any help would be greatly appreciated.
Regards,
Kevin
-
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]


Using .properties file to set elements in

2004-07-21 Thread Sam Bilbrey
I hope this is not to much of a newbie question:
 
I would like to do something like:
 
"/>
 
Any suggestions would be greatly appreciated.
 
Sam Bilbrey
[EMAIL PROTECTED]
 



Re: App scoped bean to be used with html:optionsCollection in JSP

2004-07-21 Thread Erik Weber
I load my states in two arrays in a PlugIn -- the labels ("Alabama") and 
the values ("AL"), and set them as application scope attributes.

Then I simply refer to those attributes in my combos, like this:

Because it's wrapped in an html:select with a property name that matches 
one of my form bean properties, it remains populated correctly after 
form validation errors, etc.

Hope that helps, I read this kind of quickly.
Erik

Kevin McAbee wrote:
Hello. I have searched through the list for this or similar issues but 
have been unable to find a good reference post to work off. That 
disclaimer is in the hopes that I don't get thoroughly flamed if I 
somehow missed a post. :) Also, if I am going about this the wrong 
way, *please* let me know.

I have several lists that I wish to use in forms and result pages for 
checkboxes and options. These lists (all 50 states, various 
majors/options for college, etc.) will appear on several pages across 
the application and their values placed in the database when selected. 
I want to cache or quickly pull these lists for use via tag libraries.

My current implementation is as follows:
I have my lists stored in xml files with the following design:




Example:


New York
NY


I have a class called LabelValueListBean that houses an ArrayList of 
LabelValueBeans. It has two methods of importance - populate(String 
filename) and getList().
-- getList() returns the ArrayList containing the LabelValueBeans
-- populate(String filename) is a static method that takes an xml file 
of the above format and uses Digester to create a LabelValueBean for 
each set element and to place all LabelValueBeans in an instance of 
LabelValueListBean

I then have a class that extends Plug-In to instantiate my 
application-wide objects. All of my xml files are listed by filename 
in my ApplicationResources file. I then use the messages as filename 
arguments for the populate() method of each LabelValueListBean.. I 
then set each LabelValueListBean as an attribute in the application 
scope.

Current code:
// msgres is a MessageResources object
// sc is the ServletContext object
String statesList = msgres.getMessage("list.states");
statesNew = LabelValueListBean.populate(sc.getRealPath(statesList));
sc.setAttribute("statesNew", statesNew);
// I now print out the LabelValueListBean
System.out.println(statesNew.toString());
The above executes without fail and the println shows that the 
LabelValueListBean is indeed populated.

I hope the above is enough background information to work with.
I have tried various methods, all of which failed, of accessing the 
LabelValueListBean object in a JSP page via tag libraries for use in 
html:optionsCollection and the like.

Attempts:
( is the Jakarta application tag library)





The above returns the following:
javax.servlet.ServletException: No getter method for property list of 
bean statesTest


In my desperation:




javax.servlet.ServletException: Cannot find bean Label: Alabama --- 
Value: AL
Label: Alaska --- Value: AK
Label: Arizona --- Value: AZ
... (the rest of the toString() of LabelValueListBean)


What am I doing wrong? How can I fix this? I am going about this a 
totally wrong way? I figure the solution is probably quite simple and 
under my foolish nose. Any help would be greatly appreciated.

Regards,
Kevin
-
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: App scoped bean to be used with html:optionsCollection in JSP

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Kevin McAbee [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 21, 2004 12:47 PM
> To: Struts Users Mailing List
> Subject: App scoped bean to be used with html:optionsCollection in JSP
> 

As for thorough flamings... I like my meat medium rare :)



> 
> // msgres is a MessageResources object
> // sc is the ServletContext object
> String statesList = msgres.getMessage("list.states");
> statesNew = LabelValueListBean.populate(sc.getRealPath(statesList));
> sc.setAttribute("statesNew", statesNew);
> // I now print out the LabelValueListBean
> System.out.println(statesNew.toString());

looks good.



> 
> I have tried various methods, all of which failed, of accessing the 
> LabelValueListBean object in a JSP page via tag libraries for use in 
> html:optionsCollection and the like.
> 
> Attempts:
> ( is the Jakarta application tag library)
> 
> 
>
>   
>

I think that html:optionsCollection will search up the scope to application scope to 
find statesNew.
I would check the java code and make sure that there is a getList for statesNew, then 
try and get rid of the app:attributes and see if that helps.


> 
> 
> The above returns the following:
> javax.servlet.ServletException: No getter method for property list of 
> bean statesTest
> 
> 
> 
> In my desperation:
> 
> 
> property="list"/>
> 



> 
> javax.servlet.ServletException: Cannot find bean Label: Alabama --- 
> Value: AL
> Label: Alaska --- Value: AK
> Label: Arizona --- Value: AZ
> ... (the rest of the toString() of LabelValueListBean)
> 
> 
> 
> What am I doing wrong?  How can I fix this?  I am going about this a 
> totally wrong way?  I figure the solution is probably quite 
> simple and 
> under my foolish nose.  Any help would be greatly appreciated.
> 
> Regards,
> 
> Kevin
> 
> 
> -
> 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: character encoding

2004-07-21 Thread Meier, Niclas
Hi,

to get the encoding right the outgoing encoding (JSP-page) and the incoming encoding 
have to bet he same. You should define the enconfig of the JSP by:

1. Setting the content-type in the HTML Page


2.  Defining the contentType;charset for the JSPC
<[EMAIL PROTECTED] contentType="test/html:charset=UTF-8"%>

3. Defining The encoding type and charset of the form:


The Opera and Firefox Browsers provide better informations about the content encoding 
than the IE. You should check the encoding in one of those. The browser may choose a 
different charset for displaying the page (and form) and you won't get UTF-8 data back.

This procedure worked fine on at least two major projects.

Regards,
Niclas


-Original Message-
From: Larry Young [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 9:39 PM
To: Struts Users Mailing List
Subject: Re: character encoding

Carl-Eric,

 Yes, I tried the charset on the form but found it didn't do any good.

 But what do you force the Encoding to in your Filter?  How can you 
know with any certitude how the browser encoded the data values before 
sending it to you??  It probably works well if the browser is setup to 
"auto-select" the encoding, but what do you do if they have it explicitly 
set to something other than what you are assuming?

--- regards ---
Larry


At 12:07 PM 7/21/04, you wrote:

> >  I'd like to hear how others have solved this problem.  I can see
> > that one solution is to replace the RequestProcessor and hardcode the
> > "setEncoding" on the Request to UTF-8, or subclass the whole
> > ActionServlet.  Are there any cleaner solutions?  I can't believe I'm the
> > only one to have run across this problem!  I'm not THAT unlucky! :)
>
>I am using a Filter (from the Servlet API) that gets the request
>before anything else in the chain and calls setEncoding() on it before
>passing it on.
>
>What would be great, just to get a little more consistency into this,
>would be if the html:form-tag would finally support the accept-charset
>attribute as specified in HTML4.01.
>
>HTH
>Carl-Eric
>--
>Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
>Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
>Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
>Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

--
Larry Young
The Dalmatian Group
www.dalmatian.com 



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



RE: Re[3]: character encoding

2004-07-21 Thread Hookom, Jacob
The new JSF spec does allow for Content-Type lookup, here's a bit of code
that I used in my implementation to find the content type out of that
header, it might be of some use to you or whoever:

protected static final Pattern PATTERN_CHARSET =
Pattern.compile(".*charset\\s*=\\s*([\\w\\-]+)(\\s*|;).*");

/**
 * Grab the character encoding from the request, if not found, check the
 * stored value. Finally, set the character encoding on the request
 * 
 * @param context
 * @param stored
 * @throws FacesException
 */
protected void setCharacterEncoding(FacesContext context) throws
FacesException
{
ExternalContext extCtx = context.getExternalContext();
Object request = extCtx.getRequest();
if (request instanceof ServletRequest)
{
String contentType = (String)
extCtx.getRequestHeaderMap().get("Content-Type");
String charset = null;
if (contentType != null)
{
Matcher match = PATTERN_CHARSET.matcher(contentType);
if (match.lookingAt())
{
charset = match.group(1);
}
}

if (charset == null) charset = (String)
extCtx.getSessionMap().get(CHARACTER_ENCODING_KEY);

if (charset != null)
{
try
{
((ServletRequest)
request).setCharacterEncoding(charset);
}
catch (UnsupportedEncodingException uee)
{
extCtx.log("Error Encoding: " + charset, uee);
}
}
}
}

Note, this required J2SE 1.4.

Cheers,
Jacob Hookom

-Original Message-
From: Carl-Eric Menzel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 2:44 PM
To: Larry Young
Cc: Struts Users Mailing List
Subject: Re[3]: character encoding

> Then I'm out of luck. That's the biggest problem with Strut's lack of
> support for the accept-charset attribute. *Most of the time* it works
> that if you send the response in UTF-8 the next request will come in
> as UTF-8 too. That's what I'm doing now - I send out only UTF-8 forms
> and assume that I get the same back. It's an ugly hack, but the only
> way that seems to work at the moment.

> I asked a few weeks ago if there was any way for me to extend the form
> tag to support this attribute, or whether there is any good reason why
> it is not implemented. So far I haven't received an answer.

PS: While searching for a solution I found that the HTTP spec actually
provides the browsers with a way to *specify* the encoding they're
sending, which would completely solve this issue. It appears that the
only browser that supported it *was* Mozilla. They found out that this
extended (but conforming to the spec!) Content-Type header made so
many broken CGI-scripts puke that they removed this feature again.
*sigh*

Carl-Eric
-- 
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.


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



App scoped bean to be used with html:optionsCollection in JSP

2004-07-21 Thread Kevin McAbee
Hello.  I have searched through the list for this or similar issues but 
have been unable to find a good reference post to work off.  That 
disclaimer is in the hopes that I don't get thoroughly flamed if I 
somehow missed a post. :)  Also, if I am going about this the wrong 
way, *please* let me know.

I have several lists that I wish to use in forms and result pages for 
checkboxes and options.  These lists (all 50 states, various 
majors/options for college, etc.) will appear on several pages across 
the application and their values placed in the database when selected.  
I want to cache or quickly pull these lists for use via tag libraries.

My current implementation is as follows:
I have my lists stored in xml files with the following design:




Example:

   
 New York
 NY
   

I have a class called LabelValueListBean that houses an ArrayList of 
LabelValueBeans.  It has two methods of importance - populate(String 
filename) and getList().
-- getList() returns the ArrayList containing the LabelValueBeans
-- populate(String filename) is a static method that takes an xml file 
of the above format and uses Digester to create a LabelValueBean for 
each set element and to place all LabelValueBeans in an instance of 
LabelValueListBean

I then have a class that extends Plug-In to instantiate my 
application-wide objects.  All of my xml files are listed by filename 
in my ApplicationResources file.  I then use the messages as filename 
arguments for the populate() method of each LabelValueListBean..  I 
then set each LabelValueListBean as an attribute in the application 
scope.

Current code:
// msgres is a MessageResources object
// sc is the ServletContext object
String statesList = msgres.getMessage("list.states");
statesNew = LabelValueListBean.populate(sc.getRealPath(statesList));
sc.setAttribute("statesNew", statesNew);
// I now print out the LabelValueListBean
System.out.println(statesNew.toString());
The above executes without fail and the println shows that the 
LabelValueListBean is indeed populated.

I hope the above is enough background information to work with.
I have tried various methods, all of which failed, of accessing the 
LabelValueListBean object in a JSP page via tag libraries for use in 
html:optionsCollection and the like.

Attempts:
( is the Jakarta application tag library)

  
 
  

The above returns the following:
javax.servlet.ServletException: No getter method for property list of 
bean statesTest


In my desperation:

  


javax.servlet.ServletException: Cannot find bean Label: Alabama --- 
Value: AL
Label: Alaska --- Value: AK
Label: Arizona --- Value: AZ
... (the rest of the toString() of LabelValueListBean)


What am I doing wrong?  How can I fix this?  I am going about this a 
totally wrong way?  I figure the solution is probably quite simple and 
under my foolish nose.  Any help would be greatly appreciated.

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


Re: Tag question

2004-07-21 Thread Erik Weber
Sorry if this post repeats -- I find that occasionally they are not 
making it . . .


Jim, "actor" is precisely what I meant!
It goes /context/controller/actor/usecase (in my case)
Sorry I didn't say that correctly.
But as you point out, I think it doesn't change the point of
the post, that I need to manually make sure the name of the controller
servlet gets into the hyperlinks.
I wonder if a mapping of "/services" work better than "/services/*". 
Haven't tried that . . .

Thanks,
Erik

Jim Barrows wrote:
 

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 11:32 AM
To: Struts Users Mailing List
Subject: Re: Tag question
Sorry, I should have explained better what I am doing.
My controller Servlet is mapped to /services/*
All requests for JSP pages go through the controller, via action 
mappings. The actions have paths like:

/usecase/view_edit_page
/usecase/save_existing_record
/usecase/view_add_page
/usecase/add_new_record
So the full links look like:
/services/usecase/view_edit_page
meanhwhile other resources have paths like:
/images/some_image.gif
This keeps other resources out of the scope of the controller (and 
perhaps into the scope of some other servlet). Also, direct 
JSP access 
is prohibited.

So in places where I am building hyperlinks (within JSPs), I 
need to get 
"/services" into each link, in front of the action URI, but 
behind the 
context. And I want to do this in a portable way (in case the Servlet 
mapping changes).
   

If you use html:link and forwards then you can do whatever you want, and won't 
have to change the links themselves.  This would be pretty portable as well.
 

So the idea is to put something like  which literally would be 
"/services" + "/usecase/action" or 
"/services/usecase/action". Using the 
"page" attribute to the tag makes it come out right 
("/context/services/usecase/action").

(When I say "usecase" here I really should say "collection of 
usecases" 
or "function group" to be more accurate).

I would be interested in hearing other mapping strategies. 
   

I map jsp and directories by actor rather then use case, or use case package.  
Makes everything easier (especially declaritive security, then again I've kept the 
*.do mapping, rather then what you're doing.
That would make your url something like services/actor/useCase, which doesn't get 
around your problem.
 

For now I'm 
making sure the JSP can call a method or access a variable 
that returns 
"/services".

Erik

Christian D Hahn wrote:
   

Are you mapping the jsp to /services in the web.xml? if you do, 
getServletPath should return the path you are looking for.


jsp
/usecase/page.jsp


jsp
/services

-Chris
Erik Weber wrote:
 

Hmm I must be doing something wrong. That's giving me the 
   

same value 
   

as Erez's example. Strange, I would have expected it to give me 
"/services". I wonder how I am causing it to give me 
"/usecase/page.jsp".

atta-ur rehman wrote:
   

Hi Erik,
This one worked for me:

<%= request.getServletPath() %>



HTH,
ATTA
On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber 
<[EMAIL PROTECTED]> wrote:

 

How can I set a variable (I assume with c:set) that will 
   

hold the 
   

value
of request.getServletPath, so that I can use it in el tags?
Thanks,
Erik
   

-
   

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

 

-
   

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

 

   

-
   

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


 

-
   

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

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

-
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[3]: character encoding

2004-07-21 Thread Carl-Eric Menzel
> Then I'm out of luck. That's the biggest problem with Strut's lack of
> support for the accept-charset attribute. *Most of the time* it works
> that if you send the response in UTF-8 the next request will come in
> as UTF-8 too. That's what I'm doing now - I send out only UTF-8 forms
> and assume that I get the same back. It's an ugly hack, but the only
> way that seems to work at the moment.

> I asked a few weeks ago if there was any way for me to extend the form
> tag to support this attribute, or whether there is any good reason why
> it is not implemented. So far I haven't received an answer.

PS: While searching for a solution I found that the HTTP spec actually
provides the browsers with a way to *specify* the encoding they're
sending, which would completely solve this issue. It appears that the
only browser that supported it *was* Mozilla. They found out that this
extended (but conforming to the spec!) Content-Type header made so
many broken CGI-scripts puke that they removed this feature again.
*sigh*

Carl-Eric
-- 
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.


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



Re[2]: character encoding

2004-07-21 Thread Carl-Eric Menzel
> Carl-Eric,

>  Yes, I tried the charset on the form but found it didn't do any good.

>  But what do you force the Encoding to in your Filter?  How can you
> know with any certitude how the browser encoded the data values before
> sending it to you??  It probably works well if the browser is setup to
> "auto-select" the encoding, but what do you do if they have it explicitly
> set to something other than what you are assuming?

Then I'm out of luck. That's the biggest problem with Strut's lack of
support for the accept-charset attribute. *Most of the time* it works
that if you send the response in UTF-8 the next request will come in
as UTF-8 too. That's what I'm doing now - I send out only UTF-8 forms
and assume that I get the same back. It's an ugly hack, but the only
way that seems to work at the moment.

I asked a few weeks ago if there was any way for me to extend the form
tag to support this attribute, or whether there is any good reason why
it is not implemented. So far I haven't received an answer.

Carl-Eric
-- 
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.


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



Re: character encoding

2004-07-21 Thread Larry Young
Carl-Eric,
Yes, I tried the charset on the form but found it didn't do any good.
But what do you force the Encoding to in your Filter?  How can you 
know with any certitude how the browser encoded the data values before 
sending it to you??  It probably works well if the browser is setup to 
"auto-select" the encoding, but what do you do if they have it explicitly 
set to something other than what you are assuming?

--- regards ---
Larry
At 12:07 PM 7/21/04, you wrote:
>  I'd like to hear how others have solved this problem.  I can see
> that one solution is to replace the RequestProcessor and hardcode the
> "setEncoding" on the Request to UTF-8, or subclass the whole
> ActionServlet.  Are there any cleaner solutions?  I can't believe I'm the
> only one to have run across this problem!  I'm not THAT unlucky! :)
I am using a Filter (from the Servlet API) that gets the request
before anything else in the chain and calls setEncoding() on it before
passing it on.
What would be great, just to get a little more consistency into this,
would be if the html:form-tag would finally support the accept-charset
attribute as specified in HTML4.01.
HTH
Carl-Eric
--
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Larry Young
The Dalmatian Group
www.dalmatian.com 


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


Re: character encoding

2004-07-21 Thread Carl-Eric Menzel

>  I'd like to hear how others have solved this problem.  I can see
> that one solution is to replace the RequestProcessor and hardcode the
> "setEncoding" on the Request to UTF-8, or subclass the whole 
> ActionServlet.  Are there any cleaner solutions?  I can't believe I'm the
> only one to have run across this problem!  I'm not THAT unlucky! :)

I am using a Filter (from the Servlet API) that gets the request
before anything else in the chain and calls setEncoding() on it before
passing it on.

What would be great, just to get a little more consistency into this,
would be if the html:form-tag would finally support the accept-charset
attribute as specified in HTML4.01.

HTH
Carl-Eric
-- 
Antwort: Weil es das Lesen des Textes erschwert.   | Carl-Eric Menzel
Frage  : Warum ist das so schlimm? | PGP ID: 808F4A8E
Antwort: Antworten oben zu schreiben.  | Bitte keine HTML-
Frage  : Was ist die schlimmste Unsitte in Emails? | Mails schicken.


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



RE: Tag question

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Erik Weber [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 21, 2004 11:32 AM
> To: Struts Users Mailing List
> Subject: Re: Tag question
> 
> 
> Sorry, I should have explained better what I am doing.
> 
> My controller Servlet is mapped to /services/*
> 
> All requests for JSP pages go through the controller, via action 
> mappings. The actions have paths like:
> 
> /usecase/view_edit_page
> /usecase/save_existing_record
> /usecase/view_add_page
> /usecase/add_new_record
> 
> So the full links look like:
> 
> /services/usecase/view_edit_page
> 
> meanhwhile other resources have paths like:
> 
> /images/some_image.gif
> 
> This keeps other resources out of the scope of the controller (and 
> perhaps into the scope of some other servlet). Also, direct 
> JSP access 
> is prohibited.
> 
> So in places where I am building hyperlinks (within JSPs), I 
> need to get 
> "/services" into each link, in front of the action URI, but 
> behind the 
> context. And I want to do this in a portable way (in case the Servlet 
> mapping changes).

If you use html:link and forwards then you can do whatever you want, and won't have to 
change the links themselves.  This would be pretty portable as well.

> 
> So the idea is to put something like  page="${controller_path}"> which literally would be 
> "/services" + "/usecase/action" or 
> "/services/usecase/action". Using the 
> "page" attribute to the tag makes it come out right 
> ("/context/services/usecase/action").
> 
> (When I say "usecase" here I really should say "collection of 
> usecases" 
> or "function group" to be more accurate).
> 
> I would be interested in hearing other mapping strategies. 

I map jsp and directories by actor rather then use case, or use case package.  Makes 
everything easier (especially declaritive security, then again I've kept the *.do 
mapping, rather then what you're doing.
That would make your url something like services/actor/useCase, which doesn't get 
around your problem.

> For now I'm 
> making sure the JSP can call a method or access a variable 
> that returns 
> "/services".
> 
> Erik
> 
> 
> 
> Christian D Hahn wrote:
> 
> > Are you mapping the jsp to /services in the web.xml? if you do, 
> > getServletPath should return the path you are looking for.
> >
> > 
> > jsp
> > /usecase/page.jsp
> > 
> >
> > 
> > jsp
> > /services
> > 
> >
> > -Chris
> >
> > Erik Weber wrote:
> >
> >> Hmm I must be doing something wrong. That's giving me the 
> same value 
> >> as Erez's example. Strange, I would have expected it to give me 
> >> "/services". I wonder how I am causing it to give me 
> >> "/usecase/page.jsp".
> >>
> >> atta-ur rehman wrote:
> >>
> >>> Hi Erik,
> >>>
> >>> This one worked for me:
> >>>
> >>> 
> >>> <%= request.getServletPath() %>
> >>> 
> >>>
> >>> 
> >>> 
> >>>
> >>> HTH,
> >>>
> >>> ATTA
> >>>
> >>> On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber 
> >>> <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
>  How can I set a variable (I assume with c:set) that will 
> hold the 
>  value
>  of request.getServletPath, so that I can use it in el tags?
> 
>  Thanks,
>  Erik
> 
>  
> -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> >>>
> >>>
> >>> 
> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>
> >> 
> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



character encoding

2004-07-21 Thread Larry Young
Hello,
I've run into a bit of a problem and I'd like to know how others 
have solved it.

It's basically a character encoding issue.  I post my struts-based 
JSP page to the user, they enter some data, and then submit the page back 
to my Action.  The data they enter may contain multi-byte characters.  If I 
pull the data out of the parameter list (using PropertyUtils), I'm getting 
a whole bunch of extra characters for each multi-byte character (ASCII 
works just fine).  If I set the encoding value in the Request to UTF-8 
before calling PropertyUtils, it seems to work great for non-Form data 
values.  However, the since the Form is populated before my Action is 
called, these String values have already been decoded and are wrong.

I'd like to hear how others have solved this problem.  I can see 
that one solution is to replace the RequestProcessor and hardcode the 
"setEncoding" on the Request to UTF-8, or subclass the whole 
ActionServlet.  Are there any cleaner solutions?  I can't believe I'm the 
only one to have run across this problem!  I'm not THAT unlucky! :)

Any help is most gratefully appreciated.
--- regards ---
Larry
--
Larry Young
The Dalmatian Group
www.dalmatian.com 


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


Re: Tag question

2004-07-21 Thread Erik Weber
Sorry, I should have explained better what I am doing.
My controller Servlet is mapped to /services/*
All requests for JSP pages go through the controller, via action 
mappings. The actions have paths like:

/usecase/view_edit_page
/usecase/save_existing_record
/usecase/view_add_page
/usecase/add_new_record
So the full links look like:
/services/usecase/view_edit_page
meanhwhile other resources have paths like:
/images/some_image.gif
This keeps other resources out of the scope of the controller (and 
perhaps into the scope of some other servlet). Also, direct JSP access 
is prohibited.

So in places where I am building hyperlinks (within JSPs), I need to get 
"/services" into each link, in front of the action URI, but behind the 
context. And I want to do this in a portable way (in case the Servlet 
mapping changes).

So the idea is to put something like  which literally would be 
"/services" + "/usecase/action" or "/services/usecase/action". Using the 
"page" attribute to the tag makes it come out right 
("/context/services/usecase/action").

(When I say "usecase" here I really should say "collection of usecases" 
or "function group" to be more accurate).

I would be interested in hearing other mapping strategies. For now I'm 
making sure the JSP can call a method or access a variable that returns 
"/services".

Erik

Christian D Hahn wrote:
Are you mapping the jsp to /services in the web.xml? if you do, 
getServletPath should return the path you are looking for.


jsp
/usecase/page.jsp


jsp
/services

-Chris
Erik Weber wrote:
Hmm I must be doing something wrong. That's giving me the same value 
as Erez's example. Strange, I would have expected it to give me 
"/services". I wonder how I am causing it to give me 
"/usecase/page.jsp".

atta-ur rehman wrote:
Hi Erik,
This one worked for me:

<%= request.getServletPath() %>



HTH,
ATTA
On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber 
<[EMAIL PROTECTED]> wrote:


How can I set a variable (I assume with c:set) that will hold the 
value
of request.getServletPath, so that I can use it in el tags?

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


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


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

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

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


Another site

2004-07-21 Thread dhay

Here's another site that appears to be using Struts - liteon.com.

eg. http://www.liteon.com/tool/contact/list.do?xml_id=7_4

Cheers,

David




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



RE: Formatting issues...

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 21, 2004 10:21 AM
> To: Struts
> Subject: OT: Formatting issues...
> 
> 
> i know this is a little off-topic, but i was hoping someone could
> point me in the right direction.  my client is currently using frames
> for layout in their webapp.  we're rewriting the controller and view
> using Struts.  i would prefer to get rid of the frames because of the
> heavy use of javascript in connecting everything together.  Tiles
> doesn't quite give them the functionality they are looking for.
> (having headers and footer remain stationary while the body
> scrolls...) and i'm having a hard time getting this same functionality
> to work using CSS in IE.
> any suggestions?

Yes... unfortunately you can't jail MS for writing bad software.  IE is a pain in the 
back end.  Having looked at this issue already, it's not fun.  However I do have  
a solution:


around a table you want to scroll will work in IE.  Not sure about real browsers like 
Mozilla or Opera.


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



OT: Formatting issues...

2004-07-21 Thread Andrew Close
i know this is a little off-topic, but i was hoping someone could
point me in the right direction.  my client is currently using frames
for layout in their webapp.  we're rewriting the controller and view
using Struts.  i would prefer to get rid of the frames because of the
heavy use of javascript in connecting everything together.  Tiles
doesn't quite give them the functionality they are looking for.
(having headers and footer remain stationary while the body
scrolls...) and i'm having a hard time getting this same functionality
to work using CSS in IE.
any suggestions?
anything would be greatly appreciated.
Thanks
andy

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



RE: OT: Best practice for access to file from multiple web apps

2004-07-21 Thread Jim Barrows

> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 4:39 PM
> To: Struts Users Mailing List
> Subject: Re: OT: Best practice for access to file from 
> multiple web apps
> 
> 
> On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
> > We have PDF's that can be created by one webapp, but must 
> also be served by other webapps. 
> 

 

> 
> Is it really any harder than this?  If it is, I must be 
> missing something.

I dunno.. maybe I am  my initial problem with your suggestion was writing the web 
apps to a common directory, however, I had a duh moment from reading the code in the 
tomcat 5 classpath problem thread, and can now solve that.

What you're saying is that if I do something like:
/ear/producerWar creates a pdf and puts it in /ear/producerWar/pdfLoc so it can be 
gotten to using the relative url /producerWar/pdfLoc/pdfIWant/pdf.
Then /ear/consumerWar would use a linke like /producerWar/pdfLoc/pdf, just making sure 
that struts doesn't append /consumerWar to the URL?

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



Re: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Kris Schneider
Huh. Here's a test with TC 5.0.27, JDK 1.4.2_05, and WinXP:

loadProps.jsp:
--
<%@ page contentType="text/plain" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%
String fileName = "foo.properties";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream in = cl.getResourceAsStream(fileName);
Properties props = new Properties();
props.load(in);
out.print(props);
%>

With "foo.properties" located in WEB-INF/classes, the page outputs:

{A=1, C=3, B=2}

Have you done anything to TC like create a custom Context for the app? Are you
sure target.getConfigurationName() is really returning what you expect (e.g. no
leading spaces, etc.)?

Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:

> Yep, exactly
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 21. Juli 2004 17:30
> > An: Struts Users Mailing List
> > Betreff: Re: AW: AW: OT: Problems with classpath under tomcat 5
> > 
> > Does "filename" evaluate to something like "foo.properties" (no other path
> > info)
> > and is that file located in WEB-INF/classes?
> > 
> > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > 
> > > Thanx, but it doesn't work either.
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > > > Gesendet: Mittwoch, 21. Juli 2004 16:54
> > > > An: Struts Users Mailing List
> > > > Betreff: Re: AW: OT: Problems with classpath under tomcat 5
> > > >
> > > > ..
> > > > String fileName = target.getConfigurationName() + ".properties";
> > > > ClassLoader cl = Thread.currentThread().getContextClassLoader();
> > > > InputStream in = cl.getResourceAsStream(fileName);
> > > > Properties props = new Properties();
> > > > props.load(in);
> > > > ..
> > > >
> > > > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > > >
> > > > >
> > > > >
> > > > > > -Ursprüngliche Nachricht-
> > > > > > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > > > > > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > > > > > An: Struts Users Mailing List
> > > > > > Betreff: Re: OT: Problems with classpath under tomcat 5
> > > > > >
> > > > > > Are you sure if it is not looking your properties file in the
> > > > > > classpath of the webapp ?
> > > > >
> > > > > Yes, because it would find them there.
> > > > >
> > > > > > When you say everything works fine until tomcat 5 is used , does
> > the
> > > > > > console print out any error ? Also how do you know it is searching
> > in
> > > > > > shared classes ?
> > > > >
> > > > > Yes, the console prints out our debug output:
> > > > >
> > > > > xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> > > > >
> > > > > if you read the code, you'll find that it's also trying to locate
> > the
> > > > '.'
> > > > > directory. In all other environments it's webapps/mywebapp/WEB-
> > > > INF/classes
> > > > > in tomcat5 it's .../common/classes (which is one of the pathes
> > according
> > > > to
> > > > > tomcat5 class loader faq). (Sorry, I wrote shared/classes in my
> > first
> > > > mail,
> > > > > it was common/classes, but it doesn't really matter, because both
> > aren't
> > > > the
> > > > > right ones :-)
> > > > >
> > > > > Regards
> > > > > Leon
> > > > >
> > > > >
> > > > > >
> > > > > > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > it's a bit OT but maybe some of you had a similar problem
> > shortly
> > > > and
> > > > > > > can help.
> > > > > > >
> > > > > > > We have a configuration component which configures other
> > components
> > > > of
> > > > > > > the application out of property files. The property files lies
> > in
> > > > the
> > > > > > > 'classes' directory of the application. Everything works fine
> > until
> > > > we
> > > > > > > use tomcat 5 (5.0.19).
> > > > > > >
> > > > > > > In tomcat 5 the ClassLoader doesn't search for our property
> > files in
> > > > > > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > > > > > shared/classes which imho should be done after the private
> > webapp
> > > > > > > classpath has bin searched through.
> > > > > > >
> > > > > > > As I said before it works fine with standalone applications and
> > with
> > > > > > > resin.
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > > > Regards
> > > > > > >
> > > > > > > Leon
> > > > > > >
> > > > > > > P.S.
> > > > > > >
> > > > > > > The files are there and we have the rights to read them.
> > > > > > >
> > > > > > > P. P.S. the code:
> > > > > > >
> > > > > > >   private void updateConfigurable(IConfigurable target,
> > boolean
> > > > > > > dontcheck){
> > > > > > >
> > > > > > > String fileName =
> > > > > > > target.getConfigurationName()+".properties";
> > > > > > >
> > > > > > > log.debug("Checking for "+"/"+fileName);
> > > > > > >
> > > > > > > log.debug("Approx. checking in
> >

AW: AW: AW: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Rosenberg, Leon
Yep, exactly


> -Ursprüngliche Nachricht-
> Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 21. Juli 2004 17:30
> An: Struts Users Mailing List
> Betreff: Re: AW: AW: OT: Problems with classpath under tomcat 5
> 
> Does "filename" evaluate to something like "foo.properties" (no other path
> info)
> and is that file located in WEB-INF/classes?
> 
> Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> 
> > Thanx, but it doesn't work either.
> >
> > > -Ursprüngliche Nachricht-
> > > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > > Gesendet: Mittwoch, 21. Juli 2004 16:54
> > > An: Struts Users Mailing List
> > > Betreff: Re: AW: OT: Problems with classpath under tomcat 5
> > >
> > > ..
> > > String fileName = target.getConfigurationName() + ".properties";
> > > ClassLoader cl = Thread.currentThread().getContextClassLoader();
> > > InputStream in = cl.getResourceAsStream(fileName);
> > > Properties props = new Properties();
> > > props.load(in);
> > > ..
> > >
> > > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > >
> > > >
> > > >
> > > > > -Ursprüngliche Nachricht-
> > > > > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > > > > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > > > > An: Struts Users Mailing List
> > > > > Betreff: Re: OT: Problems with classpath under tomcat 5
> > > > >
> > > > > Are you sure if it is not looking your properties file in the
> > > > > classpath of the webapp ?
> > > >
> > > > Yes, because it would find them there.
> > > >
> > > > > When you say everything works fine until tomcat 5 is used , does
> the
> > > > > console print out any error ? Also how do you know it is searching
> in
> > > > > shared classes ?
> > > >
> > > > Yes, the console prints out our debug output:
> > > >
> > > > xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> > > >
> > > > if you read the code, you'll find that it's also trying to locate
> the
> > > '.'
> > > > directory. In all other environments it's webapps/mywebapp/WEB-
> > > INF/classes
> > > > in tomcat5 it's .../common/classes (which is one of the pathes
> according
> > > to
> > > > tomcat5 class loader faq). (Sorry, I wrote shared/classes in my
> first
> > > mail,
> > > > it was common/classes, but it doesn't really matter, because both
> aren't
> > > the
> > > > right ones :-)
> > > >
> > > > Regards
> > > > Leon
> > > >
> > > >
> > > > >
> > > > > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > Hi,
> > > > > >
> > > > > > it's a bit OT but maybe some of you had a similar problem
> shortly
> > > and
> > > > > > can help.
> > > > > >
> > > > > > We have a configuration component which configures other
> components
> > > of
> > > > > > the application out of property files. The property files lies
> in
> > > the
> > > > > > 'classes' directory of the application. Everything works fine
> until
> > > we
> > > > > > use tomcat 5 (5.0.19).
> > > > > >
> > > > > > In tomcat 5 the ClassLoader doesn't search for our property
> files in
> > > > > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > > > > shared/classes which imho should be done after the private
> webapp
> > > > > > classpath has bin searched through.
> > > > > >
> > > > > > As I said before it works fine with standalone applications and
> with
> > > > > > resin.
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > > > Regards
> > > > > >
> > > > > > Leon
> > > > > >
> > > > > > P.S.
> > > > > >
> > > > > > The files are there and we have the rights to read them.
> > > > > >
> > > > > > P. P.S. the code:
> > > > > >
> > > > > >   private void updateConfigurable(IConfigurable target,
> boolean
> > > > > > dontcheck){
> > > > > >
> > > > > > String fileName =
> > > > > > target.getConfigurationName()+".properties";
> > > > > >
> > > > > > log.debug("Checking for "+"/"+fileName);
> > > > > >
> > > > > > log.debug("Approx. checking in
> > > > > > "+target.getClass().getResource("/."));
> > > > > >
> > > > > > URL u = target.getClass().getResource("/"+fileName);
> > > > > >
> > > > > > if (u==null){
> > > > > >
> > > > > >   log.error(fileName+" doesn't exist, skipping
> > > update
> > > > > > for "+target);
> > > > > >
> > > > > >   return;
> > > > > >
> > > > > > }
> > > > > >
> > > > > > if (!dontcheck){
> > > > > >
> > > > > >   log.debug("Checking "+target);
> > > > > >
> > > > > >   File f = new File(u.getFile());
> > > > > >
> > > > > >   long lastModified = f.lastModified();
> > > > > >
> > > > > >   long timestamp = getTimestamp(target);
> > > > > >
> > > > > >   if (lastModified > > > > >
> > > > > > return;
> > > > > >
> > > > > >   log.debug("filename has been updated.");
> > > > > >
> > > > > > }
>

RE: logic:iterator with a arbitrary depth of nested list

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 21, 2004 5:53 AM
> To: 'Struts Users Mailing List'
> Subject: logic:iterator with a arbitrary depth of nested list
> 
> 
> Folks,
> 
> 
> Is it possible to use a logic:iterate tag with an arbitrary 
> depth of nested
> lists.
> i.e. A List containing Lists, each of which contains a List (etc)
> 
> The depth of the tree will vary at runtime.

I don't know.  I would tend to think tha if it did, it would be a by-product of 
functionality or possibly a bug.  It wouldn't surprise if it did work though, just not 
sure why or for how long.

I would suggest doing some setup in the action class first, to make the display pieces 
job easier.  (That's my stock answer to complex display issues, since that's a good 
use of actions.)  I would also look at how various javascript tree builders work, and 
use them to do the actual display etc.  Depending on which js you use this could make 
it very easy.  Don't forget that you can use JSP to build the js on the fly if you 
need to.


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



RE: OT: Best practice for access to file from multiple web apps

2004-07-21 Thread Jim Barrows


> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 4:39 PM
> To: Struts Users Mailing List
> Subject: Re: OT: Best practice for access to file from 
> multiple web apps
> 
> 
> On Tue, 20 Jul 2004 15:35:51 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
 

> 
> Is it really any harder than this?  If it is, I must be 
> missing something.

The url part is easy. it's where the file itself gets stored.
/ear/war1
/ear/war2
/ear/pdfStorage

Wars can't see outside their context, so you can't really do what your saying, without 
putting the pdf's in each location.  Given the number and size of the PDF's, this is 
prohibitive.



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



Re: Tag question

2004-07-21 Thread Christian D Hahn
Are you mapping the jsp to /services in the web.xml?  if you do, 
getServletPath should return the path you are looking for.

 
jsp
/usecase/page.jsp
  
  
jsp
/services
  
  -Chris
Erik Weber wrote:
Hmm I must be doing something wrong. That's giving me the same value as 
Erez's example. Strange, I would have expected it to give me 
"/services". I wonder how I am causing it to give me "/usecase/page.jsp".

atta-ur rehman wrote:
Hi Erik,
This one worked for me:

<%= request.getServletPath() %>



HTH,
ATTA
On Tue, 20 Jul 2004 16:20:30 -0400, Erik Weber 
<[EMAIL PROTECTED]> wrote:
 

How can I set a variable (I assume with c:set) that will hold the value
of request.getServletPath, so that I can use it in el tags?
Thanks,
Erik
-
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: AW: AW: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Kris Schneider
Does "filename" evaluate to something like "foo.properties" (no other path info)
and is that file located in WEB-INF/classes?

Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:

> Thanx, but it doesn't work either.
> 
> > -Ursprüngliche Nachricht-
> > Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 21. Juli 2004 16:54
> > An: Struts Users Mailing List
> > Betreff: Re: AW: OT: Problems with classpath under tomcat 5
> > 
> > ..
> > String fileName = target.getConfigurationName() + ".properties";
> > ClassLoader cl = Thread.currentThread().getContextClassLoader();
> > InputStream in = cl.getResourceAsStream(fileName);
> > Properties props = new Properties();
> > props.load(in);
> > ..
> > 
> > Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> > 
> > >
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > > > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > > > An: Struts Users Mailing List
> > > > Betreff: Re: OT: Problems with classpath under tomcat 5
> > > >
> > > > Are you sure if it is not looking your properties file in the
> > > > classpath of the webapp ?
> > >
> > > Yes, because it would find them there.
> > >
> > > > When you say everything works fine until tomcat 5 is used , does the
> > > > console print out any error ? Also how do you know it is searching in
> > > > shared classes ?
> > >
> > > Yes, the console prints out our debug output:
> > >
> > > xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> > >
> > > if you read the code, you'll find that it's also trying to locate the
> > '.'
> > > directory. In all other environments it's webapps/mywebapp/WEB-
> > INF/classes
> > > in tomcat5 it's .../common/classes (which is one of the pathes according
> > to
> > > tomcat5 class loader faq). (Sorry, I wrote shared/classes in my first
> > mail,
> > > it was common/classes, but it doesn't really matter, because both aren't
> > the
> > > right ones :-)
> > >
> > > Regards
> > > Leon
> > >
> > >
> > > >
> > > > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Hi,
> > > > >
> > > > > it's a bit OT but maybe some of you had a similar problem shortly
> > and
> > > > > can help.
> > > > >
> > > > > We have a configuration component which configures other components
> > of
> > > > > the application out of property files. The property files lies in
> > the
> > > > > 'classes' directory of the application. Everything works fine until
> > we
> > > > > use tomcat 5 (5.0.19).
> > > > >
> > > > > In tomcat 5 the ClassLoader doesn't search for our property files in
> > > > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > > > shared/classes which imho should be done after the private webapp
> > > > > classpath has bin searched through.
> > > > >
> > > > > As I said before it works fine with standalone applications and with
> > > > > resin.
> > > > >
> > > > > Any ideas?
> > > > >
> > > > > Regards
> > > > >
> > > > > Leon
> > > > >
> > > > > P.S.
> > > > >
> > > > > The files are there and we have the rights to read them.
> > > > >
> > > > > P. P.S. the code:
> > > > >
> > > > >   private void updateConfigurable(IConfigurable target, boolean
> > > > > dontcheck){
> > > > >
> > > > > String fileName =
> > > > > target.getConfigurationName()+".properties";
> > > > >
> > > > > log.debug("Checking for "+"/"+fileName);
> > > > >
> > > > > log.debug("Approx. checking in
> > > > > "+target.getClass().getResource("/."));
> > > > >
> > > > > URL u = target.getClass().getResource("/"+fileName);
> > > > >
> > > > > if (u==null){
> > > > >
> > > > >   log.error(fileName+" doesn't exist, skipping
> > update
> > > > > for "+target);
> > > > >
> > > > >   return;
> > > > >
> > > > > }
> > > > >
> > > > > if (!dontcheck){
> > > > >
> > > > >   log.debug("Checking "+target);
> > > > >
> > > > >   File f = new File(u.getFile());
> > > > >
> > > > >   long lastModified = f.lastModified();
> > > > >
> > > > >   long timestamp = getTimestamp(target);
> > > > >
> > > > >   if (lastModified > > > >
> > > > > return;
> > > > >
> > > > >   log.debug("filename has been updated.");
> > > > >
> > > > > }
> > > > >
> > > > > log.debug("updating "+target);
> > > > >
> > > > > try{
> > > > >
> > > > >   Properties p = new Properties();
> > > > >
> > > > > p.load(target.getClass().getResourceAsStream("/"+fileName));
> > > > >
> > > > >   target.notifyConfigurationStarted();
> > > > >
> > > > >   Enumeration keys = p.keys();
> > > > >
> > > > >   while(keys.hasMoreElements()){
> > > > >
> > > > > String key = (String)keys.nextElemen

AW: AW: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Rosenberg, Leon
Thanx, but it doesn't work either.

> -Ursprüngliche Nachricht-
> Von: Kris Schneider [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 21. Juli 2004 16:54
> An: Struts Users Mailing List
> Betreff: Re: AW: OT: Problems with classpath under tomcat 5
> 
> ..
> String fileName = target.getConfigurationName() + ".properties";
> ClassLoader cl = Thread.currentThread().getContextClassLoader();
> InputStream in = cl.getResourceAsStream(fileName);
> Properties props = new Properties();
> props.load(in);
> ..
> 
> Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:
> 
> >
> >
> > > -Ursprüngliche Nachricht-
> > > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > > An: Struts Users Mailing List
> > > Betreff: Re: OT: Problems with classpath under tomcat 5
> > >
> > > Are you sure if it is not looking your properties file in the
> > > classpath of the webapp ?
> >
> > Yes, because it would find them there.
> >
> > > When you say everything works fine until tomcat 5 is used , does the
> > > console print out any error ? Also how do you know it is searching in
> > > shared classes ?
> >
> > Yes, the console prints out our debug output:
> >
> > xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> >
> > if you read the code, you'll find that it's also trying to locate the
> '.'
> > directory. In all other environments it's webapps/mywebapp/WEB-
> INF/classes
> > in tomcat5 it's .../common/classes (which is one of the pathes according
> to
> > tomcat5 class loader faq). (Sorry, I wrote shared/classes in my first
> mail,
> > it was common/classes, but it doesn't really matter, because both aren't
> the
> > right ones :-)
> >
> > Regards
> > Leon
> >
> >
> > >
> > > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > >
> > > > it's a bit OT but maybe some of you had a similar problem shortly
> and
> > > > can help.
> > > >
> > > > We have a configuration component which configures other components
> of
> > > > the application out of property files. The property files lies in
> the
> > > > 'classes' directory of the application. Everything works fine until
> we
> > > > use tomcat 5 (5.0.19).
> > > >
> > > > In tomcat 5 the ClassLoader doesn't search for our property files in
> > > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > > shared/classes which imho should be done after the private webapp
> > > > classpath has bin searched through.
> > > >
> > > > As I said before it works fine with standalone applications and with
> > > > resin.
> > > >
> > > > Any ideas?
> > > >
> > > > Regards
> > > >
> > > > Leon
> > > >
> > > > P.S.
> > > >
> > > > The files are there and we have the rights to read them.
> > > >
> > > > P. P.S. the code:
> > > >
> > > >   private void updateConfigurable(IConfigurable target, boolean
> > > > dontcheck){
> > > >
> > > > String fileName =
> > > > target.getConfigurationName()+".properties";
> > > >
> > > > log.debug("Checking for "+"/"+fileName);
> > > >
> > > > log.debug("Approx. checking in
> > > > "+target.getClass().getResource("/."));
> > > >
> > > > URL u = target.getClass().getResource("/"+fileName);
> > > >
> > > > if (u==null){
> > > >
> > > >   log.error(fileName+" doesn't exist, skipping
> update
> > > > for "+target);
> > > >
> > > >   return;
> > > >
> > > > }
> > > >
> > > > if (!dontcheck){
> > > >
> > > >   log.debug("Checking "+target);
> > > >
> > > >   File f = new File(u.getFile());
> > > >
> > > >   long lastModified = f.lastModified();
> > > >
> > > >   long timestamp = getTimestamp(target);
> > > >
> > > >   if (lastModified > > >
> > > > return;
> > > >
> > > >   log.debug("filename has been updated.");
> > > >
> > > > }
> > > >
> > > > log.debug("updating "+target);
> > > >
> > > > try{
> > > >
> > > >   Properties p = new Properties();
> > > >
> > > > p.load(target.getClass().getResourceAsStream("/"+fileName));
> > > >
> > > >   target.notifyConfigurationStarted();
> > > >
> > > >   Enumeration keys = p.keys();
> > > >
> > > >   while(keys.hasMoreElements()){
> > > >
> > > > String key = (String)keys.nextElement();
> > > >
> > > > String value = p.getProperty(key);
> > > >
> > > > target.setProperty(key, value);
> > > >
> > > >   }
> > > >
> > > >   target.notifyConfigurationFinished();
> > > >
> > > >   setTimestamp(target);
> > > >
> > > > }catch(Exception e){
> > > >
> > > >   log.error("updateConfigurable", e);
> > > >
> > > > }
> > > 

Re: AW: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Kris Schneider
..
String fileName = target.getConfigurationName() + ".properties";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream in = cl.getResourceAsStream(fileName);
Properties props = new Properties();
props.load(in);
..

Quoting "Rosenberg, Leon" <[EMAIL PROTECTED]>:

> 
> 
> > -Ursprüngliche Nachricht-
> > Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 21. Juli 2004 16:10
> > An: Struts Users Mailing List
> > Betreff: Re: OT: Problems with classpath under tomcat 5
> > 
> > Are you sure if it is not looking your properties file in the
> > classpath of the webapp ?
> 
> Yes, because it would find them there.
> 
> > When you say everything works fine until tomcat 5 is used , does the
> > console print out any error ? Also how do you know it is searching in
> > shared classes ?
> 
> Yes, the console prints out our debug output: 
> 
> xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]
> 
> if you read the code, you'll find that it's also trying to locate the '.'
> directory. In all other environments it's webapps/mywebapp/WEB-INF/classes
> in tomcat5 it's .../common/classes (which is one of the pathes according to 
> tomcat5 class loader faq). (Sorry, I wrote shared/classes in my first mail,
> it was common/classes, but it doesn't really matter, because both aren't the
> right ones :-)
> 
> Regards
> Leon
> 
> 
> > 
> > On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> > <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > it's a bit OT but maybe some of you had a similar problem shortly and
> > > can help.
> > >
> > > We have a configuration component which configures other components of
> > > the application out of property files. The property files lies in the
> > > 'classes' directory of the application. Everything works fine until we
> > > use tomcat 5 (5.0.19).
> > >
> > > In tomcat 5 the ClassLoader doesn't search for our property files in
> > > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > > shared/classes which imho should be done after the private webapp
> > > classpath has bin searched through.
> > >
> > > As I said before it works fine with standalone applications and with
> > > resin.
> > >
> > > Any ideas?
> > >
> > > Regards
> > >
> > > Leon
> > >
> > > P.S.
> > >
> > > The files are there and we have the rights to read them.
> > >
> > > P. P.S. the code:
> > >
> > >   private void updateConfigurable(IConfigurable target, boolean
> > > dontcheck){
> > >
> > > String fileName =
> > > target.getConfigurationName()+".properties";
> > >
> > > log.debug("Checking for "+"/"+fileName);
> > >
> > > log.debug("Approx. checking in
> > > "+target.getClass().getResource("/."));
> > >
> > > URL u = target.getClass().getResource("/"+fileName);
> > >
> > > if (u==null){
> > >
> > >   log.error(fileName+" doesn't exist, skipping update
> > > for "+target);
> > >
> > >   return;
> > >
> > > }
> > >
> > > if (!dontcheck){
> > >
> > >   log.debug("Checking "+target);
> > >
> > >   File f = new File(u.getFile());
> > >
> > >   long lastModified = f.lastModified();
> > >
> > >   long timestamp = getTimestamp(target);
> > >
> > >   if (lastModified > >
> > > return;
> > >
> > >   log.debug("filename has been updated.");
> > >
> > > }
> > >
> > > log.debug("updating "+target);
> > >
> > > try{
> > >
> > >   Properties p = new Properties();
> > >
> > > p.load(target.getClass().getResourceAsStream("/"+fileName));
> > >
> > >   target.notifyConfigurationStarted();
> > >
> > >   Enumeration keys = p.keys();
> > >
> > >   while(keys.hasMoreElements()){
> > >
> > > String key = (String)keys.nextElement();
> > >
> > > String value = p.getProperty(key);
> > >
> > > target.setProperty(key, value);
> > >
> > >   }
> > >
> > >   target.notifyConfigurationFinished();
> > >
> > >   setTimestamp(target);
> > >
> > > }catch(Exception e){
> > >
> > >   log.error("updateConfigurable", e);
> > >
> > > }
> > >
> > >   }

-- 
Kris Schneider 
D.O.Tech   

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



tomcat 5 logging problem

2004-07-21 Thread Gupta, Sahil
I cant seem to get logging working on my apache+tomcat5 set up. I have the
log4j.properties file in the tomcat_install/conf directory and the
environment variable 

CATALINA_OPTS set to
-Dlog4j.configuration=file:/c:/webmd/Tomcat4.1/conf/log4j.properties EXPORT
CATALINA_OPTS

I am attaching the log4j.properties file.

In the code, i use commons-logging jar and 

private static final Log log;
static 
{
log = LogFactory.getLog("org.abc.search");
}

to instantiate a Log object.

What could i be doing wrong?

S


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

AW: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Rosenberg, Leon


> -Ursprüngliche Nachricht-
> Von: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 21. Juli 2004 16:10
> An: Struts Users Mailing List
> Betreff: Re: OT: Problems with classpath under tomcat 5
> 
> Are you sure if it is not looking your properties file in the
> classpath of the webapp ?

Yes, because it would find them there.

> When you say everything works fine until tomcat 5 is used , does the
> console print out any error ? Also how do you know it is searching in
> shared classes ?

Yes, the console prints out our debug output: 

xyz.properties doesn't exist, skipping update for [EMAIL PROTECTED]

if you read the code, you'll find that it's also trying to locate the '.' directory. 
In all other environments it's webapps/mywebapp/WEB-INF/classes
in tomcat5 it's .../common/classes (which is one of the pathes according to 
tomcat5 class loader faq). (Sorry, I wrote shared/classes in my first mail, it was 
common/classes, but it doesn't really matter, because both aren't the right ones :-)

Regards
Leon


> 
> On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > it's a bit OT but maybe some of you had a similar problem shortly and
> > can help.
> >
> > We have a configuration component which configures other components of
> > the application out of property files. The property files lies in the
> > 'classes' directory of the application. Everything works fine until we
> > use tomcat 5 (5.0.19).
> >
> > In tomcat 5 the ClassLoader doesn't search for our property files in
> > webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> > shared/classes which imho should be done after the private webapp
> > classpath has bin searched through.
> >
> > As I said before it works fine with standalone applications and with
> > resin.
> >
> > Any ideas?
> >
> > Regards
> >
> > Leon
> >
> > P.S.
> >
> > The files are there and we have the rights to read them.
> >
> > P. P.S. the code:
> >
> >   private void updateConfigurable(IConfigurable target, boolean
> > dontcheck){
> >
> > String fileName =
> > target.getConfigurationName()+".properties";
> >
> > log.debug("Checking for "+"/"+fileName);
> >
> > log.debug("Approx. checking in
> > "+target.getClass().getResource("/."));
> >
> > URL u = target.getClass().getResource("/"+fileName);
> >
> > if (u==null){
> >
> >   log.error(fileName+" doesn't exist, skipping update
> > for "+target);
> >
> >   return;
> >
> > }
> >
> > if (!dontcheck){
> >
> >   log.debug("Checking "+target);
> >
> >   File f = new File(u.getFile());
> >
> >   long lastModified = f.lastModified();
> >
> >   long timestamp = getTimestamp(target);
> >
> >   if (lastModified >
> > return;
> >
> >   log.debug("filename has been updated.");
> >
> > }
> >
> > log.debug("updating "+target);
> >
> > try{
> >
> >   Properties p = new Properties();
> >
> > p.load(target.getClass().getResourceAsStream("/"+fileName));
> >
> >   target.notifyConfigurationStarted();
> >
> >   Enumeration keys = p.keys();
> >
> >   while(keys.hasMoreElements()){
> >
> > String key = (String)keys.nextElement();
> >
> > String value = p.getProperty(key);
> >
> > target.setProperty(key, value);
> >
> >   }
> >
> >   target.notifyConfigurationFinished();
> >
> >   setTimestamp(target);
> >
> > }catch(Exception e){
> >
> >   log.error("updateConfigurable", e);
> >
> > }
> >
> >   }
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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



Re: OT: Problems with classpath under tomcat 5

2004-07-21 Thread Peng Tuck Kwok
Are you sure if it is not looking your properties file in the
classpath of the webapp ?
When you say everything works fine until tomcat 5 is used , does the
console print out any error ? Also how do you know it is searching in
shared classes ?

On Wed, 21 Jul 2004 15:45:01 +0200, Rosenberg, Leon
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> it's a bit OT but maybe some of you had a similar problem shortly and
> can help.
> 
> We have a configuration component which configures other components of
> the application out of property files. The property files lies in the
> 'classes' directory of the application. Everything works fine until we
> use tomcat 5 (5.0.19).
> 
> In tomcat 5 the ClassLoader doesn't search for our property files in
> webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
> shared/classes which imho should be done after the private webapp
> classpath has bin searched through.
> 
> As I said before it works fine with standalone applications and with
> resin.
> 
> Any ideas?
> 
> Regards
> 
> Leon
> 
> P.S.
> 
> The files are there and we have the rights to read them.
> 
> P. P.S. the code:
> 
>   private void updateConfigurable(IConfigurable target, boolean
> dontcheck){
> 
> String fileName =
> target.getConfigurationName()+".properties";
> 
> log.debug("Checking for "+"/"+fileName);
> 
> log.debug("Approx. checking in
> "+target.getClass().getResource("/."));
> 
> URL u = target.getClass().getResource("/"+fileName);
> 
> if (u==null){
> 
>   log.error(fileName+" doesn't exist, skipping update
> for "+target);
> 
>   return;
> 
> }
> 
> if (!dontcheck){
> 
>   log.debug("Checking "+target);
> 
>   File f = new File(u.getFile());
> 
>   long lastModified = f.lastModified();
> 
>   long timestamp = getTimestamp(target);
> 
>   if (lastModified 
> return;
> 
>   log.debug("filename has been updated.");
> 
> }
> 
> log.debug("updating "+target);
> 
> try{
> 
>   Properties p = new Properties();
> 
> p.load(target.getClass().getResourceAsStream("/"+fileName));
> 
>   target.notifyConfigurationStarted();
> 
>   Enumeration keys = p.keys();
> 
>   while(keys.hasMoreElements()){
> 
> String key = (String)keys.nextElement();
> 
> String value = p.getProperty(key);
> 
> target.setProperty(key, value);
> 
>   }
> 
>   target.notifyConfigurationFinished();
> 
>   setTimestamp(target);
> 
> }catch(Exception e){
> 
>   log.error("updateConfigurable", e);
> 
> }
> 
>   }
> 
>

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



testing struts and locale

2004-07-21 Thread Alex
Greetings,

I've been using strutstest http://strutstestcase.sourceforge.net/ which
works fine.

I can even verify that the proper error messages are
being sent back:

verifyActionErrors(new String[] {"error.no.id.provided"});

Question i have is that, is there a way to simulate a different locale,
and see if it will return back the appropriate message key.  I need to
ensure that code is providing errors in multiple languages, and that they
are all configured properly before it moves on.

thanks.
-sd


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



OT: Problems with classpath under tomcat 5

2004-07-21 Thread Rosenberg, Leon
Hi, 

 

it's a bit OT but maybe some of you had a similar problem shortly and
can help.

 

We have a configuration component which configures other components of
the application out of property files. The property files lies in the
'classes' directory of the application. Everything works fine until we
use tomcat 5 (5.0.19). 

In tomcat 5 the ClassLoader doesn't search for our property files in
webapps/mywebapp/WEB-INF/classes. Instead it seems to search in
shared/classes which imho should be done after the private webapp
classpath has bin searched through. 

 

As I said before it works fine with standalone applications and with
resin. 

 

Any ideas?

 

Regards

Leon

 

P.S. 

 

The files are there and we have the rights to read them.

 

 

P. P.S. the code:

 

  private void updateConfigurable(IConfigurable target, boolean
dontcheck){

String fileName =
target.getConfigurationName()+".properties";



log.debug("Checking for "+"/"+fileName);

log.debug("Approx. checking in
"+target.getClass().getResource("/."));



URL u = target.getClass().getResource("/"+fileName);

if (u==null){

  log.error(fileName+" doesn't exist, skipping update
for "+target);

  return;

}



if (!dontcheck){

  log.debug("Checking "+target);

  File f = new File(u.getFile());

  long lastModified = f.lastModified();

  long timestamp = getTimestamp(target);

  if (lastModified

RE: Validate at least one check box is checked

2004-07-21 Thread McCormack, Chris
yes thanks. How it relates to struts thought is another matter.

-Original Message-
From: Mazen, Tamer S [mailto:[EMAIL PROTECTED]
Sent: 21 July 2004 14:25
To: '[EMAIL PROTECTED]'
Subject: FW: Validate at least one check box is checked


> Dears,
> Does any one know how to implement 'at least one check box is checked' validation on 
> a list of checkboxes.
> Thanks 
> 
> Tamer Mazen
> Information Analyst
>  
> E  
> Egypt Solution Center (CMM L2 Organization)
> Commercial Professionals Syndicate Building, 5th floor
> 29 Emtedad Ramsis st., Nasr City, Cairo, Egypt
>  
> Phone:*   (202) 4882-897
> Fax:  1   (202) 3425-130
> Email:*   [EMAIL PROTECTED]
> 

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


***
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.



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



FW: Validate at least one check box is checked

2004-07-21 Thread Mazen, Tamer S
> Dears,
> Does any one know how to implement 'at least one check box is checked' validation on 
> a list of checkboxes.
> Thanks 
> 
> Tamer Mazen
> Information Analyst
>  
> E  
> Egypt Solution Center (CMM L2 Organization)
> Commercial Professionals Syndicate Building, 5th floor
> 29 Emtedad Ramsis st., Nasr City, Cairo, Egypt
>  
> Phone:*   (202) 4882-897
> Fax:  1   (202) 3425-130
> Email:*   [EMAIL PROTECTED]
> 

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



Velocity vs tags (was JSF vs Struts)

2004-07-21 Thread David Evans
Rick, 

Could you elaborate on what you find distastful about Velocity? I've
just started using it as my primary presentation layer tool in struts,
because i found the templating language so clean and clear. The ablitiy
to stick what ever object i'd like in its context, and then refer to it
in a simple intuitive language construct was fresh air for me. Tastes
vary, i know, but maybe you've run across things i haven't yet, that
turned you off.

dave


On Sun, 2004-07-18 at 23:56, Rick Reumann wrote:
> Craig McClanahan wrote:
> 
> > For applications you are about to start on, if it is your intent to
> > use the Struts HTML tags for your view tier, you should review that
> > decision in the light of the developments of the last few months,
> > since the JSF spec went final, to say nothing of the availability of
> > alternative view tier technologies (XML, Velocity, ...) that work with
> > Struts as well.  If these tags work for you, that's fine ... but be
> > aware that you are buying in to a mature technology that is unlikely
> > to change much in the future.
> 
> Craig, can you elaborate on this a bit more? I'm confused because if you 
> went with a different front end presentation other than JSP and Struts 
> HTML form tags, why would it matter that you chose Struts HTML tags for 
> the JSP portion? If you later chose an XML/XSLT or Velocity 
> (yuk:)solution for your view you'd end up scrapping the JSPs altogether 
> anyway so why would it matter what tags you used to build the JSPs that 
> you would be replacing? Or are you basically saying to not even bothr 
> using JSPs for a front end view? (I've seen good velocity templates and 
> I'll take a *clean* JSP using JSTL and tags over Velocity any day of the 
> week). Thanks for your thoughts and all your work on Struts, JSF, 
> Tomcat, etc.




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



logic:iterator with a arbitrary depth of nested list

2004-07-21 Thread Adam Lipscombe
Folks,


Is it possible to use a logic:iterate tag with an arbitrary depth of nested
lists.
i.e. A List containing Lists, each of which contains a List (etc)

The depth of the tree will vary at runtime.

I am trying to model the "levels" of an enterprise from top down and want to
construct a JavaScript tree view of the enterprise.


I can do this straightforwardly in Java/JSP, but recursion is required for
processing the child lists.



TIA - Adam




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



apache@apache.org

2004-07-21 Thread ron1
Hi,
The Torque users mailing list seems not to function anymore...
Greetings,
Ron
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Validating list of inputs using Struts Validation

2004-07-21 Thread Mazen, Tamer S
Dears,
I have order items form, which user enter list of the order's items in a
list, I tried to validate user inputs using Struts validator, for server
side it works fine but for unfortunality it does not work in client side
validation. I heard that struts does not support client validation of array
of inputs. Can any one tell if that is right or not and when it will be
supported coz I think it is very important in web application.

Thanks in Advance

Tamer Mazen
Information Analyst
 
E  
Egypt Solution Center (CMM L2 Organization)
Commercial Professionals Syndicate Building, 5th floor
29 Emtedad Ramsis st., Nasr City, Cairo, Egypt
 
Phone:  *   (202) 4882-897
Fax:1   (202) 3425-130
Email:  *   [EMAIL PROTECTED]


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