• 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

Servlet to control navigation in a web site.

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create a servlet to control the navigation in a website that consists of several HTML pages.

Each page will have various buttons or links that will define some actions to be executed.

The navigation rules I want to be specified in a text file with entries like: source_pag.html, action, dest_page.html

Can anyone give me some examples on how to do this ? I tried to find some examples on the internet but nothing that could help me.
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Negru Ionut Valentin wrote:I want to create a servlet to control the navigation in a website that consists of several HTML pages.



What do you want to control the navigation? something like back/forward buttons in browser?
 
Negru Ionut Valentin
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to control the buttons/links in the html pages ... and the actions for the links/buttons to be specified into that text file ...
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Negru Ionut Valentin wrote:I want to control the buttons/links in the html pages ... and the actions for the links/buttons to be specified into that text file ...


Still not clear for me, please explain why do you need for that?
 
Negru Ionut Valentin
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I want to change the action for a link/button so i could do it from the text file and not from the html page where the link/button is ...
 
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
Sounds like a simple use of a properties file to me.
 
Negru Ionut Valentin
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give an example or a link where I can see something like this being implemented ?
I am new at this

I will try and explain a little more what i want to do:

I will have a text file(let's call it rules.txt) having data like "page1 -> page2".

I will have multiple pages(simple .html pages) that contain buttons(we can call them back/next or anything else) that go from the current page to some other page.

Now my servlet will identify the page that it is displayed and when the button will be pressed it will go to the page indicated in the rules.txt file ...

I don't know how else I can explain this ...

If you have any ideas or any examples to work on it will be great

 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Negru Ionut Valentin wrote:If I want to change the action for a link/button so i could do it from the text file and not from the html page where the link/button is ...



I got your idea now. So let use a properties file to store your action link/URL. Then if you want to change later, change the value in properties file.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I already said.

Properties are easy to either read into a Map to place in application context at startup time, or to use directly on JSP pages with the <fmt:message> tag of the JSTL.
 
reply
    Bookmark Topic Watch Topic
  • New Topic