• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Frontman 2.0 vs /WEB-INF

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've written a simple command that logs a user in and then forwards to a specific view, but when the forward ends with a error about not finding the WEB-INF command.
Plus i filter the request by the state of the session (inactive/invalid -> login, valid -> go on)
I don't know how to fix this problem.

These are my files:
web.xml

LoginCommand

And i receive this error:
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the URL you are hitting?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And this:

<servlet-mapping>
<servlet-name>CommandBroker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>



is very, very wrong. This will route every request through the command broker. Even images and the like. Not what you want. Follow the patterns suggested. I use:
 
R Gonzalez
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want the url format to be /<contex-path>/command_name, not /<context-path>/command/command_name
do i have to write a specific filter that forwards each /command_name request to a /command/command_name request?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. How is the container supposed to differentiate command requests from other requests such as for CSS stylesheets, images, or scripts without its own mapping?

I'll never understand why people get so hung up on the format of URLs and the unreasonable control that they want to exert over them.

I suppose you could possibly write an over-complicated filter. But the whole point of FrontMan is to make command dispatching simple.
 
R Gonzalez
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wanted the url to be the most simple and readable possible. That's why i overcomplicate things
Maybe i'm understanding and using frontman in the wrong way...

Anyhow i came up with a filter (very simple, too) that verifies if the url points to a real path. if not, it forwards the request to /command/<requested-command> unless it already starts with /command
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic