David Rocks

Ranch Hand
+ Follow
since Apr 24, 2001
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Rocks

Think I am resigning myself to the cookie/url/session split now.

Thought I could get something from manipulating the hosts and/or server config.
10 years ago

I have a tomcat server (7.0.35) that takes in requests from different domain URLs, the content shown on the page differs depending on the domain url.

The problem I am having is that if I hit the same jsp on the same server from the same browser with a different domain url I get a different session made, I would like the session to remain over the different domains for functional reasons.

I have tried modifying the server configuration. single sign on, crossContext etc etc but I am guessing, I cannot see anything explicitly that refers to this scenario, most of the documentation refers to cross context authentication.

Any thoughts on the matter would be appreciated.


10 years ago
Checking the docs I think I max be able to do it using

@BAtchSize and setting up and @OrderBy to return last first.
Is this possible?

I have an object that holds a collection (a large one).

I am only interested in the last object in ( PK will be max ) is there a way to get a collection containing only the last one in or a way to have an single object that is populated with the last one in using annotations?

Thanks in advance for any help.
Works like a dream, checked out the trunk and the jars were in there.

Ploughs through the DB of RSS links I have and handles all the discrepancies and differences without issue.


Thanks, Ulf.

That looks perfect.

Found this article which pretty much describes the code I need...



Just wondered if anyone knows of a RSS library or toolkit that takes in RSS/atom feed etc URLs and will produce an object map for me?

I'm wanting to store feeds from multiple sites and have written a simple class to do the job but there is so much variation in the feeds I could keep writing code for days to cover all the bases. I would think there is something out there that would help but cannot find anything.

I stopped working on the total EJB stack about revision 2.1 and I have some questions on how the containers now act.

Basically is there still seperate web and ejb containers? If I call a session bean from a servlet/jsp/action to return a persisted object is that persisted object now detached or are the web and EJB containers merged into one now?

I ask this as I recently looked in on an EJB 3 project on JBoss 4.5 where you had to load up the persisted object with everything you thought it would need before passing it to the servlet as then it was detached. I cannot see this as a good solution.


David Newton wrote:The action tag, which is generally avoided precisely because of issues like this (and a few others), is basically processing a request. Meaning if you pass in a parameter it'll be set. If you don't want to modify it then set ignoreContextParams to true.

So far I haven't seen anything unexpected. Awfully sorry to "waste your time" by trying to help and understand--it won't happen again.

The page display is off the back of one request and the action tag will be creating another request, the action called by the URL and the action called by the tag are different.

The second request is therefore modifying data on the first request. That is clearly unexpected.
13 years ago

David Newton wrote:By the "second action" you mean the action called via the action tag?

I think you're just not understanding how the action tag and S2 requests work. Also, why would you replace things in a URL with non-URL-encoded values? Why not use mechanisms that already exist?

I understand perfectly how the actions work, if you take the time to read through the description of the issue you will see that. Once again..

I pass an attribute to an action in a URL
my action modifies that attribute.
the action forwards to the JSP which displays the attribute

If I have an action tag on that screen the attribute will be displayed as the value from the URL

If I do not have an action tag the attribute will be diplayed as the value from the action.

If you cannot see that is unexpected and incorrect behaviour we are wasting out time here.
13 years ago

David Newton wrote:I think I don't understand what you're saying.

If you modify a Hibernate object inside a transaction with a commit at the end it's going to get updated in the DB. That doesn't have anything to do with Struts at all.

Ignore the hibernate issue, it is a knock on from the struts issue,.

In the first action I take the object from the request and modify the name on it, when the second action is called struts sets the name back to the original value despite the second action having no interest whatsoever in the modified object.

That most certainly is a struts issue and is wrong in my opinion

13 years ago
Recently I changed my application from RestfullMapper to using wilcards and this has created some pretty strange behaviour from my app.

I have chosen one particular case to explain and wondered if anyone has any ideas before I start debugging through the struts code, the behaviour is pretty strange and I doubt it is meant to work this way.

I have a JPA entity object, Competition, an Action CompetitionAction, a persistance mananger ComptitionManager and a displayCompetition.jsp. All very basic. I am using the basic 'session in view' pattern from hibernate.

my xml for this is..

CompetitionAction holds a competition object.

My interceptors are params, staticParams and actionParams

myURL is


now as competition name can have spaces when I display the URL I replace the spaces with -s and then the view method replaces them back to spaces. The view method calls a select in the CompetitionManager, places that in the competition variable in CompetitionAction, forwards onto displayCompetition.jsp and everything is OK.

The problem arises as I have an action called within displayCompetition.jsp that shows a simple count(*) from a table which is to be displayed.

Even though this has nothing to do with the competition object it kicks of a call to the Competition object and resets the name to the one with hyphens in it. Take that page located action out and it's all fine, put it back and it goes wrong.

This has another serious issue as the get and display is all done in one request, at the end of the render a hibernate commit is called and it places the hyphenated name into the database.

As far as I can tell the stack is dealing out copied object to the actions, probably passed by value although I am not sure just yet. Depsite me changing the value of the object on my first action that gets blasted on subsequent calls to other actions.

This is either a very simple config change or a more serious underlying issue in struts IMO.

I will probably post this to the user lists later, I cannot access them at my current location.

13 years ago

Is there any way to do this in tomcat? A plugin or something.

My pages are very dynamic and they are a bit of a mess when they get to the browser.


13 years ago
Is there a way to default all URLs in the application to use the root namespace?

I am having problems with a third party tag that creates links in my site as I cannot set namespace='/' in the link. It appends different namespaces together in links.

I have tried setting alwaysSelectFullNamespace = false

I am using the RestActionMapper and seems to be linked to this issue http://issues.apache.org/struts/browse/WW-2428

my struts version is 2.1.6

13 years ago

David Newton wrote:You use JSPs in Swing?

I would not have a problem in putting the logic into a JSP and mapping the xml file to the jsp.

I wrote the servlet on the train home and I thought about the xml file as a jsp or a servlet.

If I was to do a sitemap.jsp with a sitemap.xml the it would be natural to place the same logic of a sitemap.jsp into a sitemap.xml.

There is no specific architectural reason why the logic has to go into a servlet.
13 years ago