Re: JSTL toUpperCase

2007-01-24 Thread Bob Arnott

[EMAIL PROTECTED] wrote:

So I have to change it to this:
http://java.sun.com/dtd/web-app_2_4.dtd"; >


Try



http://java.sun.com/xml/ns/j2ee";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

  ...



--
Bob Arnott


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



Re: how to pass value in html:text from action

2005-11-29 Thread Bob Arnott

Stanislav wrote:

[snipped...]





You can't embed tags within tags... Try something like:




Alternatively, use an action to populate the form bean.

Cheers,

--
Bob Arnott


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



Re: How to escape a string on a description field

2005-10-24 Thread Bob Arnott

C.F. Scheidecker Antunes wrote:

Hello all,

I am having problems with my struts app.

I am trying to enter a long string on a description field of a MySQL 
database but it crashes if the string has caracters that need to be 
escaped.


org.apache.commons.lang.StringEscapeUtils is your friend, especially
public static String escapeSql(String str).

Cheers,

--
Bob Arnott


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



Re: Serializing Form-Beans with XML

2005-10-17 Thread Bob Arnott

gollinger wrote:

Hi,
has someone made experiences in using a 
tool which can serialize Beans to XML-Files

and works stable and properly.
For example that can also handle String Arrays?


http://jakarta.apache.org/commons/betwixt/

"The Betwixt library provides an XML introspection mechanism for mapping
beans to XML in a flexible way. It is implemented using an XMLIntrospector
and XMLBeanInfo classes which are similar to the standard Introspector and
BeanInfo from the Java Beans specification.

Betwixt provides a way of turning beans into XML as well as automatically
generating digester rules in a way that can be customized on a per type
manner in the same way that the BeanInfo mechanism can be used to customize
the default introspection on a java object."

Cheers,

--
Bob Arnott


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



Re: [OT] SCM stories (war? horror?)

2005-09-16 Thread Bob Arnott

[EMAIL PROTECTED] wrote:
I'm preparing to make a case for switching to a differenct SCM tool 
(source code management).   The options are CVS, Perforce, and VSS.


Anybody have any cogent/credible stories or arguments for choosing one 
over the other?


Don't touch Perforce with a barge pole it doesn't integrate very well
with IDE's or Cruise Control etc and is a general pain in the arse. VSS,
are you being serious...? Out of those three I'd take CVS every time,
although you may want to look at Subversion as well.

Cheers,

--
Bob Arnott


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



RE: basics of struts

2005-09-05 Thread Bob Arnott
Ankit Pancholi wrote:
> Hey thanks a lot. Changing classpath to servlet.jar helped. Can you
> tell me the argument type for check box. I tried Boolean considering
> it as on or off but it didn't work.

Try "boolean", not "Boolean"...

-- 
Bob Arnott



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



RE: javascript

2005-07-06 Thread Bob Arnott
Vijay K Anand wrote:
> Hi All
> 
> I used the same way  you have said
> 
>  id="create_portfolio">javascript:location.href=' page="/portfoliomgmt"/>'
>  property="Create" value="Create"  styleClass="NPIButton"
> onclick="<%=create_portfolio %>" />
> 
> html code generated is
>  onclick="javascript:location.href='/portfoliomgmt'"
> class="NPIButton"> 
> 
> but the problem is .do missing ...

If you want the .do bit to automatically be appended for you, then use:



http://struts.apache.org/userGuide/struts-html.html#rewrite

-- 
Bob Arnott



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



RE: javascript

2005-07-06 Thread Bob Arnott
Vijay K Anand wrote:
> Hi
> 
> This code is not actually translating
>  styleClass="NPIButton"
> onclick="javascript:location.href=\' page='/portfoliomgmt'/>\'" /> 
> 
> how do i do it?

You can't embed tags in other tags... Off the top of my head try 
something like:

javascript:location.href=''
 

Cheers,

-- 
Bob Arnott



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



RE: trouble passing multiple parameters using

2005-06-23 Thread Bob Arnott
Phani wrote:
> Here is my code in the JSP page:
> 
>  property="storeNumber"/>
> 
>  property="storeName"/>
> 
> <%
>java.util.HashMap params = new java.util.HashMap();
>params.put("storeNo",param1);
>params.put("storeName",param2);
>pageContext.setAttribute("storeInfo", params);
> %>
> 
>  paramName="storeInfo" scope="page"> Click Here
> 

You want to specify the Map under the attribute "name", not "paramName", so:

Click 
Here

See - 

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

Cheers,

-- 
Bob Arnott



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



RE: Tiles: How to nest attributes! Is it possible?

2005-06-07 Thread Bob Arnott
Nils Liebelt wrote:
> Hi all,
> 
> Let's say I got a typical tile main layout definition:
> 
>  path="/common/mainLayout.jsp">  value="/common/header.jsp" />  value="sample" type="string"/>  value="/common/footer.jsp" /> 
> 
> Now the content has to split into 2 panes. But not
> always. So I would like to have definition who looks like
> this: 
> 
>  extends=".mainLayout">  value=".splitPane" type="definition"/>  name="content.menu" value="lalelupo"/>  name="content.body" value="la le l"
> type="string"/>  
> 
> The syntax is not right but it explains what I want. Is
> it possible some how. I can only access "menu" and "body"
> as beans. All other tiles insert tags are useless.

I have achived this by doing the following (I don't claim this is 
the best or correct way to do it, it's just worked for me).

In my definitions file I have something like the following -

 

 
  


 
  
  


 
  
  


 
  


Then I have something like the following for teh two tiles JSP files:

default.jsp --

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-bean-el"; prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html-el"; prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles-el"; prefix="tiles" %>



  


  




  
  

  

  
  

  

  
  

  

  
  

  





left-right-split.jsp --

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-html-el"; prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles-el"; prefix="tiles" %>




  


  
;" />
  
  

  




  
;" 
/>
  
  

  

  
  

  
<%-- Left part goes here... --%>

  
  
<%-- Right part goes here... --%>

  




page-left.jsp and page-right.jsp are just the content of the page you want 
to display.

I hope this helps.

Cheers,

-- 
Bob Arnott



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



Tiles woes

2005-06-02 Thread Bob Arnott
Hello list, I'm having a small problem with tiles at the moment 
and I don't know if what I'm trying to do is correct etc. Maybe 
the collective wisdom and shed some light on what I'm doing 
wrong...

I've got a default definition, say for example:

<%@ taglib uri="http://struts.apache.org/tags-tiles-el"; prefix="tiles" %>


  








I can then put other tiles into this definition to extend the 
look and feel, thus I've got a further two definitions, both
for a graphical frame, one with and the other without a menu.

<%@ taglib uri="http://struts.apache.org/tags-tiles-el"; prefix="tiles" %>

  

  
  


  


  
  



  



  


However, to get the frameBody bit to display I have to pass
it through in the original default.jsp file thus:


  
  

  


Otherwise I get an exception telling me that nothing could be 
found for attribute frameBody.

Now I want to also create a poage that has the frame and two column
so I created another definition to handle this:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles-el"; prefix="tiles" %>

  


  
;" />
  
  

  




  
;" 
/>
  
  

  

  
  

  

  
  

  





  

  

  
  


So I should now have a page that's got the frame and has two columns
one at 40% and the other at 60%. Except I don't. I'm padssing through 
all the attributes - frameBody, left, leftWidth, right and rightWidth
on both the default.jsp and the frame-no-menu.jsp. 

When I specify a page that uses the .frameMenu definition it works 
okay and displays my page. when I try and use the .40-60split 
definition I get a page that displays my frame, but nothing in the 
frameBody.

I've output the frameBody attributre and I have confirmed that it 
contains what I expect, i.e. /tiles/left-right-split.jsp, but it's 
just not being displayed. 

Am I totally barking up the wrong tree with this? Can you build pages 
with tiles like this, or are you supposed to o it via multiple 
definitions like:




  
  



  


Any help anyone can give me with this would be much appreciated.

Cheers,

-- 
Bob Arnott



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



RE: JSTL fmt:message with modules

2005-05-26 Thread Bob Arnott
Martin Gainty wrote:
> BobThis tutorial from Nick Heudecker may helpAssuming you
> place
> ApplicationResources.properties,FrenchApplicationResources.properties
> in WEB-INF/classes key="EnglishResources" parameter="ApplicationResources"/>
>  parameter="FrenchApplicationResources"/>The most common
> Struts tag to use is the bean:message tag. This tag
> allows you to load a specific message resource from the
> bundle using the "key" attribute. It also allows you to
> populate any or all of the four arguments in the value:
>  key="some.message.key"/>The html:message tag allows you
> to display errors (default) or messages to the user,
> while html:errors will only display error messages.
> Messages and errors must be present in the request,
> obviously, or there will be nothing to display. Here is
> an example of displaying the messages:
> 
> 
>   
> 
>   
> 
>   
> 
> Anyone else?Martin

I'm not trying to display a different internationalised bundle, 
I'm using JSTL not the Struts bean taglib. I want to know how the 
 tag will pick up the resource bundle key under 
Globals.MESSAGE_KEY for each module while in a tiles template.

Cheers,

-- 
Bob Arnott

Software Developer
Autonomy Systems Ltd.
Cambridge Business Park
Cowley Road
Cambridge
CB4 0WZ

T: +44 (0) 1223 448 000
F: +44 (0) 1223 448 001
http://www.aungate.com/



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



RE: JSTL fmt:message with modules

2005-05-26 Thread Bob Arnott
Martin Gainty wrote:
> Bob-
> assuming you set userLocale to english north america
>  border="0" width="100%">
> 
> 
>  
> 
>basename="com.abcbank.example.ApplicationResources">
>  
> 
> 
> 
> 
> 
> 
> so in the jsp if variable userLocale is set as Locale
> userLocale = new Locale("fr", "CA");
> header.title key is located in
> ApplicationResources_fr_CA.properties located on the
> com/abcbank/example folder 
> and if header.title = Banque de Quebec
> that is what you would see

I'm not asking about locales, I'm asking how you tell the 
tag which bundle to use when you have multiple default bundles as a result 
of having multiple modules. 

I currently have an application that has four modules, each with multiple 
resource bundles. I access the default resource bundles in each module:

 or,


Struts stores the bundles in the application scope with the module name
appended to the Globals.MESSAGE_KEY constant, for example - 

org.apache.struts.action.MESSAGE/moduleOne

I'm writing a new app and I've decided to use JSTL instead of the non 
struts-el tags. Now I probably didn't make myself clear in my last post,
does Struts do something so that the  tag works in a similar 
way, thus you can do:



So that it doesn't matter what module you are in you'll get the right 
bundle...? 

Cheers,

-- 
Bob Arnott



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



JSTL fmt:message with modules

2005-05-25 Thread Bob Arnott
Hello, just trying out JSTL on a new app I'm writing as I thought 
it was about time I used it. However, I'm having a bit of trouble
with the  tag as I don't know how to specify the 
correct bundle to use.

I'm using modules and tiles, so each module has it's own resource 
bundle, but they share the tiles templates. I'm trying to pass a 
page title with a tiles definition and have it pulled from the 
resource bundle and displayed. But I don't know how to tell the 
 tag which bundle to use...?

...

  
  

...

I've seen some web pages mention that you can put a context param 
in the web.xml:


  javax.servlet.jsp.jstl.fmt.localizationContext
  ApplicationResources


But Shirley this wont work for modules...? Can anyone shed some
light on how I get this to work...?

Thanks,

-- 
Bob Arnott



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



Re: Please wait page

2005-04-07 Thread Bob Arnott
Shiva Narayana wrote:
Asuthosh,
This one is different from my requirement...i want to display the
message when the action class loading ...but in this case it it is
displaying the message when the page is loading...
You want to have an intermediate page then. User clicks on link, you display
an intermediate page with animated gif, or whatever, meanwhile you've a bit
of JS on this page that has called the action that you require and it's off
getting the actual results. When it's got them it just forwards to the results
page.
original Page --> intermeditate page --> Action --> results page
Cheers,
--
Bob Arnott
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: status messages in tag

2005-04-01 Thread Bob Arnott
Fumo, Vince wrote:
ok follow-up and I'm sure this one will take 2 seconds to answer.. 

part 1) is there a JSTL way to do the ? 
Probably, but I've not used JSTL...
part 2) What does it mean when the status message from the below code by Bob
comes out as a literal (i.e.. <%=rollOverText%>) instead of the string it
represents? I've checked the scriptlet outside of the tag and it outputs
correctly. I'm thinking that the  tag isn't pre-processing the
scriptlet?
Irt was off the top of my head I I realise that I made an error -
window.status=''; return true;
http://www.google.com"; target="_blank" 
onmouseover="<%=rollOverText%>">...
Is what you want (I think)... You can't mix the <%= %> bit inside a string
within a tag attribute, if you get me. So attr="<%= ... %>" is okay, but
attr="string(<%= ... %>)" isn't.
Cheers,
--
Bob Arnott
Software Developer
Autonomy Systems Ltd.
Cambridge Business Park
Cowley Road
Cambridge
CB4 0WZ
T: +44 (0) 1223 448 000
F: +44 (0) 1223 448 001
http://www.aungate.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: status messages in tag

2005-03-31 Thread Bob Arnott
Fumo, Vince wrote:
I want to implement a status message on a rollover for some of my links. I
was considering doing something like:
http://www.google.com"; target="_blank"
onmouseover="window.status='Go go google';return true">
which works fine. 

However, what I really want to do is pull the status message from my struts
message-resources bundle for I18N. The only way I can think to do this is to
use a scriptlet like :
http://www.google.com"; target="_blank" 
onmouseover="window.status='<% getMessage("message.key");%>';return true">
Off the top of my head, you could try something like this -

http://www.google.com"; target="_blank" 
onmouseover="window.status='<%=rollOverText%>'; return true;">...
--
Bob Arnott
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Which stream to use for a new suite of applications

2005-03-21 Thread Bob Arnott
Hello list, currently the place I work at has a number of web application
which are all separate, all maintained by different teams and all have 
sections of similar functionality that has been implemented individually 
in each project. Bit of a nightmare really.

Anyway, it's being mooted that we should move to a common framework and 
have a suite of common components that can be slotted into each application
as needs be.

Currently all the applications use Struts 1.1 with a couple using XSLT 
instead of JSP's. So there is scope to make a suite of common action 
classes and JSP's etc. Although they all have their own visual identity
so generating the JSP's would need to be done via some sort of rendering 
tag.

I was just wondering if you had the chance to start from fresh with a 
number of web applications to write, which stream of Struts would you 
use...? 1.x or go for something like Shale, or maybe even something else?

Would I be correct in thinking that if I used JSF, I could write custom 
tags and have a different renderer for each application that simply deals 
with the visual identity of each application? For example, one application 
uses  tags to group form items, while another uses  tags 
with border styles set.

Cheers,

-- 
Bob Arnott



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


RE: Placing message beans inside other tages

2005-03-10 Thread Bob Arnott
haim wrote:
> HI.
> 
> Please forgive me if this is a stupid question , I failed
> to find an answer for this issue.
> 
> How do I place a message into an attribute of a taglib.
> For example lets assume that I want to place the src of
> an image from a recourse bundle. Using the 
> tag. 
> 
> I thought that this should work
> 
> 
> 
> But i get the  as string
> and not as a the message itself.

Use the srcKey attribute on the  tag to specify the property 
in your resource bundle that you want to use:

http://struts.apache.org/userGuide/struts-html.html#img



Cheers,

-- 
Bob Arnott



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



RE: How to handle Dates?

2005-02-25 Thread Bob Arnott
Brian McGovern wrote:
> Hi looking for input on how to approach dates across all
> levels of my struts app.  Mainly what approach will allow
> me to handle formatting on the presentation layer.  
> 
> Is there any tag lib available in struts to handle
> formatting of a date type object ? 

I wrote my own tag to format dates before I came across the Jakarta 
Taglibs. You could try the Date/Time taglib if you don't want to use 
JSTL.

http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html

Cheers,

-- 
Bob Arnott



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