Fletcher Munson

Ranch Hand
+ Follow
since May 16, 2007
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fletcher Munson

I found if I add a startDate and endDate attribute this issue goes away. Though the calendar then defaults the the startDate, which in my case is about 21 years ago and not likely to be used. Does anyone have any suggestions on how to default this calendar to a preset date without any value in the field?
13 years ago
I'm using Struts 2.1.6 and I have my sx:dateTimePicker working for the most part, but I'm running into an issue when the user removes the date in the field. It changes everything in the calendar dropdown to NAN (except for the month which is changed to 'undefined'). Is there a work around for this?

Thanks,

Fletch
13 years ago
I'm currently upgrading from Struts 2.0.14 to 2.1.6. I have existing Struts 1.X in place as well as AJAX. My AJAX is on a page which is almost exclusively Struts 1 and was working fine with 2.0.14, but now I'm getting the "There is no Action mapped for namespace / and action name populateSelect" error. I'm not exactly sure what I need to map. I'm also wondering if this is going to mean I need to change my JSPs wherever I'm using AJAX. Can somebody point me in the right direction? Please let me know if I can provide any more information that would clarify my predicament?

Thanks,

Fletch
13 years ago
I have the below code on a JSP that's included in two different pages. This runs fine on one page, but not on the other.

To clarify, running fine means my releaseLocks function is called and my DWR call gets to the server when I close my browser window. I had a previous problem with this as my browser window was closing before the DWR called got finished, but if I added - alert("hello"); - the code DWR call completed without an issue. The suggestion I found was to add another event to give the browser something to do so the asynchronous DWR call could complete before the browser was closed. So I added the releaseStub function, and this solve my issue for one page but not the other.



Does anybody have any suggestions? Or can someone point me in the right direction? Please let me know if more clarification is needed.

Thanks in advance,
Fletch
I need to pass a Javascript Array full of data to my Struts 2 action. I'm currently doing this on submit by assigning the Array to a hidden field:

I have this sending through the value to a String array, but it appears in my action as a single element in the array with comma delimited values. My questions are:
Is there a better way to do this?
Is there a way to get an actual array passed through to my action?

Thanks,
Fletcher
13 years ago
We are in the process of converting our app from Struts to Struts 2, and I'm running into an issue with roles. When using Struts we would display a link based on a user role by using the following in the jsp:



There doesn't appear to anything similar in Struts 2 (or maybe I have to look harder). The only alternative I could think of is to do something like:



Is there a more simple option? Any recommendations are welcome.

Thanks in advance,
Fletch
13 years ago
Thanks. I just discovered that myself, but perhaps you could tell me the difference between using request and prototype?
I'm using the xmlns and xsi:schemaLocation attributes in my beans tag for my applicationContext.xml file instead of using the dtd for defining DOCTYPE. The problem I'm running into is I can't define the bean tags with singleton="false". I need to have a couple of the classes in the applicationContext file as singletons, but I also need to have some of them not be singletons. There just doesn't seem to be singleton attribute available when I'm using namespace instead of a DTD. Can anyone help?

Thank you in advance,
Fletcher
Ever have those moments were you feel totally brilliant? This is not one of them.

Thanks again.
13 years ago
How do pull messages from the package.properties file for my actions? I'm running some user entered data against my DB, and need to display an error message if the validation fails. I would like to just define the message in the package.properties file with the rest of the ones I've defined for the xml validation, but I don't understand how to access them in the validate method in my action. I thought it would be something like addActionError("myMessage");, but this only displays myMessage on the GUI. Can someone give me a hint?

Thank you in advance,
Fletcher
13 years ago
That's what I'm trying to do. Only I don't have access to the DB to create one. Hibernate was supposed to have a way to create one using the subselect tag in the mapping file. Only problem is there isn't much documentation, and I can't seem to figure it out.
I have a list of transactions beans I need to display to a user. I also need to provide edit links for each transaction. Now each transactions has to go to it's own transaction type page when a user hits the edit link. Each transaction type processes in a different manner so I would like to put these in seperate actions (all extending a base action). I don't know the transaction type until I'm writing the bean to the user interface. So my question is how can I dynamically define my action in my s:url tag? Below is my current tag setup. What I would like to do is replace the action="editTransactionAction" with something dynamic.

The transaction bean does have a type so it would be possible to call transaction.type to get a string value so I'd like to do something like:

action="transaction.type + Action"

Can anybody help set me straight here?

And yes, that is a struts 1 <bean:write> tag - we are in the process of converting our app, and some pages are mixed.
13 years ago
I have a query (below) that needs to pull the most recent activity by transactionId (FK in a transactions table).



The query works exactly how I want it, but when I try to use it in Hibernate I have trouble converting it over. I currently use the SQLQuery interface to run this, but I would like to use a criteria query though I can't seem to find any way to do it. The closest I've come was the <subselect> tag in the mapping file to attempt to create a view. I'm not seeing much documentation on this tag, and it's not totally clear how to use it or what I'm doing wrong. In fact, I'm not ever sure how to access/utilize the view via java after it's mapped properly (DetachedCritiera maybe?).


Can someone help understand how to use this subselect - and will it even do what I want it to?

Thank you in advance.
I'm entering transactions for an accounting system, and I need to retrieve the list based on the type of transaction. I use an initial action on page load to determine what the list will contain. I need to perform the same assessment during validation. If I just use a getter I didn't think the jsp would know about the type when it renders the page. Or am I wrong?

This brings me to my next question which I think should be a new topic.

Please take a look:

https://coderanch.com/t/428245/Struts/Using-multiple-JSPs-one-Action
13 years ago
I'm trying to figure out how to use multiple pages for one action. All the fields are identical, but depending on the page different info needs to be saved/displayed/validated/etc. The problem I'm running into is when the validation fails. I need to know which input to return to. For example the ".transaction.Contribution" should also be able to return to ".transaction.Withdrawal"



I thought I saw something using an asterisk notation for the action or method="{1}", but I can't seem to find much that elaborates on this or how to use it. Can anyone help me out?
13 years ago