[S2] Can a custom component have a body? or, using with themes

2007-10-02 Thread Jim Cushing
Is something like this legal in a Struts 2 custom component: Some text to be wrapped in my component. In other words, can act like, for example, ...s.form>? I'd like to create a HTML fieldset component that plays well with themes. But this doesn't result

Re: Where is struts-*.tld

2007-10-05 Thread Jim Cushing
Those files don't exist in Struts 2. Struts 2 is very different than Struts 1, and is based off of WebWork, so many of the files and JSP you're used to don't exist, struts-*.tld among them. All the JSP tags included with S2 start with (e.g., ), instead of , , etc. Approach Struts 2 as if

Re: Where is struts-*.tld

2007-10-05 Thread Jim Cushing
k! On Oct 5, 2007, at 5:55 PM, mjparme wrote: Yeah, I have done more reading about Struts 2 vs 1. Didn't realize it was that different. I will probably just kick back down to the most recent Struts 1 release so I am in known territory. Jim Cushing wrote: Approach Struts 2 as if you

Re: Bookmarking functionality in struts

2007-10-15 Thread Jim Cushing
It's been a while since I've used Struts 1.x, but back in the day, I did implement this type of functionality. Basically, the app would redirect to the login action, with the destination what the user tried to access) as an encoded parameter in the URL. Something like "/ login.do?destination

Re: validator shortcuts idea

2007-10-16 Thread Jim Cushing
Despite the redundancy, having separate validators is nice since it allows you to customize the error message. For example, you might want to say, "Please enter your age," "Age must be a valid number," and, "You must be at least 13 years old to ride this ride." On Oct 16, 2007, at 3:44 PM,

Re: Struts2 Tags and HTML Encoding

2007-10-17 Thread Jim Cushing
Add escape="false" to your tag: On Oct 17, 2007, at 2:00 PM, Tom Holmes Jr. wrote: This is probably a very easy question ... and I'm probably just having one of those "brain-fart" moments. I'm using struts2 and that works fine ... I've got a bean created and in session, so I can use the:

Re: struts 2 action messages / action errors

2007-10-24 Thread Jim Cushing
Struts 2 allows you to style them, but using themes. Themes are both more powerful and more complicated than what Struts 1 offered. Before you dive into customizing a theme, see if you can style it entirely with CSS. You're best better is probably to "View source" in your browser to see the

Re: Struts2 version 2.1

2007-10-26 Thread Jim Cushing
It's been on the main Maven repository since Tuesday: http://repo1.maven.org/maven2/org/apache/struts/struts2-core/2.0.11/ So, Maven 2 users should be able to update to it without problem. And if you're not using Maven, you should be! (Just kidding! I don't mean to start a build tool war).

Re: Need Help Struts 2.0.8

2007-11-01 Thread Jim Cushing
It's not necessary to do declare 10 variables. Here's an example: http://struts.apache.org/2.x/docs/tabular-inputs.html By the way, Struts 2.0.11 is out, so Raguveer, you might want to upgrade. The answer to your particular question doesn't change, but there are some bug and security fixes y

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] Tooltip and simple theme

2007-11-20 Thread Jim Cushing
You can use the "title" property, which generates a title attribute in the HTML. Most browsers will render this like a tool tip when the user hovers over the element. On Nov 20, 2007, at 4:21 PM, Jiang, Jane (NIH/NCI) [C] wrote: Hi, I have an application developed ready for test. Now I ha

Re: ant, maven and creating war's

2007-08-29 Thread Jim Cushing
I haven't touched Ant in years, so I can't help you much there, but with Maven 2, it's as simple as running 'mvn package'. The POM itself says whether the project produces a JAR, WAR, or some other artifact, so package always builds the appropriate artifact for the project. For a web app, t

Re: ant, maven and creating war's

2007-08-29 Thread Jim Cushing
I just got more and more frustrated, as I just dont know where to start. Has anyone a got starting point, link, etc. for me? On Wed, 2007-08-29 at 13:20 -0400, Jim Cushing wrote: I haven't touched Ant in years, so I can't help you much there, but with Maven 2, it's as simple as runni

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Jim Cushing
Some other things you can use: ${myActionProperty.subProperty!} Prints nothing if subProperty doesn't exist or is null ${myActionProperty.subProperty?default("default value") Prints "default value" if subProperty doesn't exist or is null The first expression (ending with !) is most similar in

Re: creating a dummy session object for unit testing

2007-09-13 Thread Jim Cushing
If your Action implements SessionAware, you don't need to make a mock HttpSession at all. You just make a new HashMap, stuff it with the values you want, and call action.setSession(). Just one more of the things I love about Struts 2. :) But there are libraries around that do allow mock Htt

Re: creating a dummy session object for unit testing

2007-09-13 Thread Jim Cushing
The session object is a simple Map, so creating it is easy. First, you have to define an instance variable in which to store the session, and second, you need to implement the setSession() method. public class MyAction implements SessionAware { private Map session; public void setSessi

Re: [FRIDAY] JPA War Stories?

2007-09-14 Thread Jim Cushing
I've been using JPA annotations with Hibernate for a while, but still using the Hibernate API (SessionFactory, etc.). Those are great, and I felt right at home with them after using XDoclet to set up Hibernate mappings for about two years before that. I'm just getting started using the Pers

Re: More tutorial questions

2007-09-18 Thread Jim Cushing
That class was built for JDK 1.5/Java 5, and you're running JDK 1.4. Is running Java 5 an option for you? If not, you might be able to re- compile XWork for 1.4. On Sep 18, 2007, at 2:50 PM, Slattery, Tim - BLS wrote: What's with com.opensymphony.xwork2.ActionSupport? I don't see anything li

Re: [Struts 2] Read request attribute in struts.xml

2007-09-24 Thread Jim Cushing
Mark Menard's excellent Struts 2 Cookbook shows you how to do this. http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect If you've never seen his Cookbook, I definitely recommend taking a look. It's got some great tips. On Sep 24, 2007, at 11:02 AM, Xibin Liu wrote: Hi, I set a