Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Wes Wannemacher
Have you tried to use a struts2 tag with OGNL? If I am understanding correctly, you could use - @s.property value="@[EMAIL PROTECTED]('OGNL.pathTo.variable') Of course, I don't know freemarker, and this is assuming you can reach the variable from OGNL. -W On 11/9/07, Scott Kingdon <[EMAIL PROTE

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
--- Scott Kingdon <[EMAIL PROTECTED]> wrote: > Thank you for that. That was a huge step in the > right direction. However, that does not work. *lol* Huge step off a short pier--I'm good at those. Hmm, yeah, I didn't know about the lack of JSP tag file support, but that's a good one to keep a hand

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
Thank you for that. That was a huge step in the right direction. However, that does not work. freemarker.core.InvalidReferenceException: on line 4, column 146 in template/xhtml/components/loginlink.ftl unitag.phone not found. I found a snipped over on Freemarker's forum that says Freemarker does

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
http://struts.apache.org/2.x/docs/freemarker.html Towards the bottom. --- Scott Kingdon <[EMAIL PROTECTED]> wrote: > If that works that would be great. I tried it, but > maybe I am doing > something wrong. > > In the JSP world, in order to use an el function you > need to declair > it at the to

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
If that works that would be great. I tried it, but maybe I am doing something wrong. In the JSP world, in order to use an el function you need to declair it at the top of the page like this: <%@ taglib prefix="uni" uri="UniFunctions" %> When I put this at the top of a Freemarker page, it just ge

Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
Since you can use any S2 tag inside a FreeMarker template I guess I had assumed you could use the same syntax to call static methods you can from JSP, does that not work? (AFAIK you can also expose the JSTL library to a FreeMarker page but I'm not sure how the two ELs would play together; w/ OGNL

Re: Display tags within one line

2007-11-09 Thread Jeromy Evans
Hi Emi Lu, The default struts2 tags use themes that determine how they are formatted as html[1]. The default theme 'xhtml' wraps each form input inside a table cell and prepends it with a label to the left or above. The css_xhtml theme uses the same layout with divs. You have two options:

Re: Display tags within one line

2007-11-09 Thread Dave Newton
Use the simple theme. d. --- Emi Lu <[EMAIL PROTECTED]> wrote: > Hello, > > May I know how to keep all checkbox in one line > please? > >name="value1_search" /> >name="value2_search" /> > >name="value3_search" /> > > I'd like to display > > value1 val

Re: Display tags within one line

2007-11-09 Thread Scott Kingdon
Use . This will allow you to have 100% control over the form html. Notice that by dong this you will have to handle all the formatting of the table by yourself. -Scott On Nov 9, 2007 3:48 PM, Emi Lu <[EMAIL PROTECTED]> wrote: > Hello, > > May

Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
I am very used to using JSP taglibs and el functions for formatting text. In my current application I am using Struts2 with Freemarker as the templating engine. I need to format a phone number that is pulled from the database as 88 to be (888)888-. Using el functions you can just call a

Display tags within one line

2007-11-09 Thread Emi Lu
Hello, May I know how to keep all checkbox in one line please? I'd like to display value1 value2 value3 in one line, but *not* value1 value2 value3 Did I do something wrong? May I know how to display all tags within one line please? Would also like to dis

Re: S2 best location of application init params

2007-11-09 Thread Dave Newton
In addition, the application context is available to S2 actions w/o being tied to servlet. d. --- Wes Wannemacher <[EMAIL PROTECTED]> wrote: > There are two other options that I've used in the > past... One is > Spring. You could create a custom bean or set of > beans and initialize > them with

Re: S2 best location of application init params

2007-11-09 Thread Jim Cushing
If you're using Spring (and if you're not, now might be the time to consider it), I'd say make that a property of your application object that needs to configuration. That is, using your example, say you've got a class, TransactionLogger that needs "the home directory of the file system to which

Re: S2 best location of application init params

2007-11-09 Thread Wes Wannemacher
There are two other options that I've used in the past... One is Spring. You could create a custom bean or set of beans and initialize them with Spring and use the spring plug-in to help get at those beans any time you need them. Spring is a big framework though and will add some complexity. The o

Re: The breadcrumbs have been served!

2007-11-09 Thread stanlick
Hey Emi Lu -- The breadcrumb plug-in keeps a trail of crumbs up to the max you specify. If you want to clear it (or manipulate it in some way) at particular points in your workflow, you can do that by requesting it from the session and doing whatever you like. The documentation reveals how it is

Re: S2 best location of application init params

2007-11-09 Thread tom` frost
I would still need to use the Servlet API to retrieve those values, correct? I'm trying to find a way to pass in values directly to Struts, I guess. On 11/9/00, Martin Gainty <[EMAIL PROTECTED]> wrote: > > Hi Tom- > > how about implementing the default initialisation parameters by placing > the >

Re: The breadcrumbs have been served!

2007-11-09 Thread Emi Lu
Can you describe what logic you are looking for? > What sort of application are you working on? Sorry, I did not know how the breadcrumb plug-in works. I hope the demo of "http://www.strutsschool.com/"; is not the showcase of how the plug-in works. The example shown by apache websites is

Re: The breadcrumbs have been served!

2007-11-09 Thread Emi Lu
There is a slight issue with www.strutsschool.com (demo site for the breadcrumb plugin?). This breadcrumb never got cleaned. For example, when user goes from home to page1 then to page 2, I would expect showing Home > Page1 > Page2 When Users go back to Page1, showing "Home > Page1"

Re: S2 best location of application init params

2007-11-09 Thread Martin Gainty
Hi Tom- how about implementing the default initialisation parameters by placing the init-param in web.xml? e.g. debug true M-- - Original Message - From: "tom` frost" <[EMAIL PROTECTED]> To: Sent: Friday, November 09, 2007 12:41 PM Subject: S2 be

S2: dynamic forwarding from Action class to external url

2007-11-09 Thread Jiang, Jane (NIH/NCI) [C]
I am also trying to forward my Action to an external report URL after process the form. I tried to use redirect and it always prefix my URL with my application context. I also tried to implement ServletResponseAware and use response.sendRedirect(). It does not seem to do anything. The default

Re: [S2]Pass error message from called page back to calling page

2007-11-09 Thread Dave Newton
addActionError(...)? --- Justin Frost <[EMAIL PROTECTED]> wrote: > > My situation is that I have an input jsp. On submit > I call my struts action > and do a DB query. If I get an empty result I want > to be directed back to > the original input jsp and display an error message. > > What is c

S2 best location of application init params

2007-11-09 Thread tom` frost
I'm looking for the best place to put application init stuff. I'm thinking of something like the home directory of the file system to which the application will write to. What's the best way of apssing such information in. In the past I have used servlet api init params, but with all the effort

[S2]Pass error message from called page back to calling page

2007-11-09 Thread Justin Frost
My situation is that I have an input jsp. On submit I call my struts action and do a DB query. If I get an empty result I want to be directed back to the original input jsp and display an error message. What is considered the best method for doing this? I could add the message to the session c

Re: [struts] Thanks! Works also with redirect actions...

2007-11-09 Thread Dale Newfield
Dave Newton wrote: You mean on a Result type? On the "redirectAction" result type. Personally I'd prefer this as the *default* behavior and force you to specify if you *did* want "empty" parameters included, but that's just me. I agree, but I don't think the patch should change current beha

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Martin Gainty
referencing the dojo.js shipped with 2.0.11 \struts\struts-2.0.11\src\core\target\classes\org\apache\struts2\static\dojo \src\namespaces java -jar F:\RHINO\rhino1_6R5\js.jar Rhino 1.6 release 5 2006 11 18 js> load("dojo.js"); js: "dojo.js", line 11: uncaught JavaScript runtime exception: ReferenceE

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Ted Husted
I wonder if it would be possible to retrofit the 2.1 Dojo plugin for 2.0? -Ted. On Nov 9, 2007 8:25 AM, Antonio Petrelli <[EMAIL PROTECTED]> wrote: > 2007/11/9, Sami Dalouche <[EMAIL PROTECTED]>: > > If anyone is interested, I have created my own dojo 1.0.0 theme for > > standard Struts 2 tags. (

struts 2: data lost when switching from jsp1 to jsp2 and back

2007-11-09 Thread hillybilly
hi, i'm new in struts2 (i did already a projekt with struts 1) and i cannot find lot of support/tutorials in the internet. until now, i like struts2 and the new improvements. but i'm stuck with this: i have 2 forms, on form1 the user enters data and selects "actionA" which directs him to form2.

Re: [S.2.1] Wildcard Mappings + Struts s:url tag

2007-11-09 Thread Thilo Ettelt
Ok, how embarassing. Struts 1 got me trapped in this one, thus I considered that I'd have to pass the same action name as specified in the action mappings. Which is stupid of me because now it's Struts 2 and now it's Wildcards. ;) Using: solved my problem easily... - Thilo Thilo Ettelt wr

[S.2.1] Wildcard Mappings + Struts s:url tag

2007-11-09 Thread Thilo Ettelt
Hello, I'm new to this list. I've learned a lot from the Confluence, but I couldn't figure out how to reassemble an wildcard action mapping using the s:url. I figured that when there is an wildcard action and it can put parts of the request uri into my action bean or result string, then how ca

Re: Creating and setting properties of collections

2007-11-09 Thread Dave Newton
Pardon the disheveled nature of this response :/ Whether or not the image object need to be "recreated" is more an issue w/ your persistence mechanism, but you'll at least need some sort of UID for each. On the S2 side you can create a map keyed on the UID and expose whatever properties you want

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Antonio Petrelli
2007/11/9, Sami Dalouche <[EMAIL PROTECTED]>: > If anyone is interested, I have created my own dojo 1.0.0 theme for > standard Struts 2 tags. (works on Dojo 2.0.11). Sami and Alvaro: if you want to contribute the Dojo 1.0 theme, then you probably file a JIRA issue. The simplest thing to do is crea

Re: [s2] templating approach / own tag?

2007-11-09 Thread Antonio Petrelli
2007/11/9, lbastil <[EMAIL PROTECTED]>: > > > But what I originally thought of was something like parametrized approach > of: > http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component > > (I think for smaller substructures it could be reasonable) Ah ok so you wanted to create an UI

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Dave Newton
103: dojo.version = { 104: // summary: version number of this instance of dojo. 105: major: 0, minor: 4, patch: 0, flag: "", 106: revision: Number("$Rev: 6258 $".match(/[0-9]+/)[0]), from the uncompressed file. --- Jeromy Evans <[EMAIL PROTECTED]> wrote: > Does anyone know -exactly- which

Re: [struts] Thanks! Works also with redirect actions...

2007-11-09 Thread Dave Newton
--- Dale Newfield <[EMAIL PROTECTED]> wrote: > ...any struts committers reading this: If I provided > a patch for an extra specially named parameter like > "supressEmptyParameters" that did just what you'd > expect, what are the chances that someone would > commit it? You mean on a Result type?

Re: [s2] templating approach / own tag?

2007-11-09 Thread lbastil
Thank you all for the hints. Finally I used tiles as it was recommended. But what I originally thought of was something like parametrized approach of: http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component (I think for smaller substructures it could be reasonable) basti newton

Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm
wiki updated http://cwiki.apache.org/confluence/display/S2WIKI/Creating+a+custom+Dojo+profile+for+Struts+2.0.x Jeromy Evans wrote: Urgh... I was trying to create a build from the src in 2.0.9 as well without any progress. Glad you solved it. Yes, please go ahead and update the wiki. I was the

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Alvaro Sanchez-Mariscal
Hi Sami, My company (Salenda) is willing to contribute to get a production-quality version. Perhaps sharing source code in a cvs/subversion may be a good starting point. Anybody else interested? Alvaro. On Nov 9, 2007 12:09 PM, Sami Dalouche <[EMAIL PROTECTED]> wrote: > If anyone is interested

Creating and setting properties of collections

2007-11-09 Thread Mark Steyn
Forgive me is this is a very obvious question, but I'm new to struts 2, and despite googling around, I'm still not sure as to how to do something. I'm trying to accomplish the following: 1. Create a form which is used upload a zip file containing a number of images 2. Upload and process those ima

Re: dojo version in struts 2.0.11?

2007-11-09 Thread Sami Dalouche
If anyone is interested, I have created my own dojo 1.0.0 theme for standard Struts 2 tags. (works on Dojo 2.0.11). It's far from being *clean*, far from being complete, uses undocumented attributes, but is a good starting guide to create progressive JavaScript enhancement (falls back to pure HTML

RolesInterceptor. How to..?

2007-11-09 Thread Filippov, Andrey
Hi everybody! I need to configure the login and authorization system in my application. I have struts2 together with jboss and mysql. I found the following information about it: (http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/RolesInterceptor.html, http://st

Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Jeromy Evans
Urgh... I was trying to create a build from the src in 2.0.9 as well without any progress. Glad you solved it. Yes, please go ahead and update the wiki. I was the original author of that page and that's why it's a wiki :-) Max Pimm wrote: Solved. I have downloaded and created the custom b

Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm
Solved. I have downloaded and created the custom build from the dojo 0.4.0 release instead of dojo 0.4.2 and now all works well. From comparing files i am pretty sure that 0.4.0 was the release used in the struts2.0.11, 2.0.10, 2.0.9 and 2.0.8 releases but it would be good if someone could co

dojo version in struts 2.0.11?

2007-11-09 Thread Jeromy Evans
Does anyone know -exactly- which revision of dojo is bundled in Struts 2.0.11? A diff of the src dirs reveals it's not the tagged 0.4.2 release or tagged 0.4.3 release. I believe it's near 0.4.2 but can't find a match. The dojo plugin in Struts 2.1.x definitely uses the 0.4.3 tagged release.

Re: OGNL struts property

2007-11-09 Thread
Horay! You are the first person to actually see and acknowledge the problem. So far I have only recieved comments about the difference between the hash and the non hash version - which I get. But no one has explained why in the case of #2 OGNL returns null and not the value of the property as in #

Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm
I am using firebug and Venkman to debug. No requests are sent to get data for the list. After debugging the problem seems to be that the Struts comboBoxDataProvider's init method never gets called. This means the widget never loads data from the server. Every time the user edits the input field