aspose file tools *
The moose likes Servlets and the fly likes Servlet to control navigation in a web site. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet to control navigation in a web site." Watch "Servlet to control navigation in a web site." New topic
Author

Servlet to control navigation in a web site.

Negru Ionut Valentin
Greenhorn

Joined: Mar 04, 2009
Posts: 21
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.
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
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

Joined: Mar 04, 2009
Posts: 21
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

Joined: Oct 13, 2011
Posts: 119
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

Joined: Mar 04, 2009
Posts: 21
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 ...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61792
    
  67

Sounds like a simple use of a properties file to me.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Negru Ionut Valentin
Greenhorn

Joined: Mar 04, 2009
Posts: 21
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

Joined: Oct 13, 2011
Posts: 119
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61792
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet to control navigation in a web site.