Meaningless Drivel is fun!
The moose likes Struts and the fly likes cleaning up .do URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "cleaning up .do URL" Watch "cleaning up .do URL" New topic

cleaning up .do URL

Gran Roguismo
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
this is really more of a nitpick item than a real issue, but I like to have my URL look as clean as possible
Currently in my actions I am extending LookupDispatchAction. This means that I need to have the "method" parameter populated when I hand off to the page.
I have overridden the unspecified() method so that it will go to a default pae, but it still needs to have method in that url:

the problem is that I am not navigating to this page via a page sumbit, and so that needs to be coded in.
Is there another way to do this without putting it into the url though?

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

You shouldn't need the method in your URL. It will call unspecified() if you don't, which is want you want, right?

A good workman is known by his tools.
Gran Roguismo
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
when I do that I get this

Request[/example] does not contain handler parameter named method

when I simply put in the ?method after that however (as specified above) it does use the unspecified method.

Perhaps somewhere along the line I have coded something wrong. Does anyone have a simple example I can use to set this up right. I really didn't think it was hard. Here is what my method looks like inside of the action it's hitting:
I agree. Here's the link:
subject: cleaning up .do URL
It's not a secret anymore!