Results 1 to 4 of 4

Thread: Dynamic page content

  1. #1
    Join Date
    Nov 2009
    Posts
    37

    Dynamic page content

    I would like to build a site that identifies all departments and towns of India. I want to create a page listing all the departments of India. When you click on a department, we are referring to a page containing a list of cities that are located in this department. Each city is clickable and gives access to a description of the town centers of activities etc.

    I wonder if you have a method to avoid creating one by one the pages of all cities. It should be that the content varies according to the clicked link, but would need the url also changes:
    if I click on Mumbai and then Gateway of India , I'd like a url type:
    http://www.mydomain.com/Mumbai/gateway-of-india.dhtml

    Is that possible in Java (I also tried using struts)? Or PHP is required?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Dynamic page content

    Yes, it is possible in Java or PHP. We call that the url rewriting.
    For more info: http://msdn.microsoft.com/en-us/library/ms972974.aspx

    You can do it in Java, Struts or any other frameworks.

  3. #3
    Join Date
    Nov 2009
    Posts
    37

    Re: Dynamic page content

    For the url rewriting no problem. Thank you for the tutorial, it will help me, I'll try to implement the Java. But it's for creating jsp I want more info.

    At first I thought creating a jsp containing the list of departments. Then the creation of cities according to the department. Imagine I'm on my jsp departments. I would like to avoid creating a jsp for each department. The jsp is designed to list the towns represented in this department. At worst I could do it manually (just 90 + pages to create is not at all a death). It was after that dynamic content interests me. Once the list of cities in a region, I would avoid creating for each city a jsp containing the details of cities. (it would be several thousands of pages to be created).

    How to have a standard page with content and the URL varies depending on the link from? (only a few sentences of description varies depending on the cities, the rest must be identical on all )

    That's how I see it: (I'm in struts)
    -Create a JSP containing a classical listing of every department of India.
    -Insert in database all cities of India(found on the web)
    -We create a new jsp whose contents vary depending on user choice. If the user has previously clicked the department 75, is retrieved via a SQL query all cities whose digits begins with 75. A question I ask myself: the most effective it is given by sending a GET parameter passing as the department?
    -The result: once the cities shown, it must be able to click on each of these cities Therefore, I create a new jsp which will describe the selected city. I guess I will add this description in database.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Dynamic page content

    You're not far from the solution. That's what I advise:

    - Create a page listing the departments index.jsp.
    I advise you to generate a list of departments from the database. Each department is pointing to the page with a parameter department.jsp number of departments. Example: "department.jsp?department = 2A"

    - Department.jsp create a page that retrieves the parameter department. From this setting, the list of cities is displayed via a query in your database.
    Each point on the city page city.jsp with parameter in the city number.

    - City.jsp create a page that retrieves the number of town. From this setting, the details of the city are displayed with access to your database.

    Concerning your questions:

    - Method for sending parameters
    => POST or GET, whatever, you earn nothing effective. To retrieve the url parameters:
    Code:
    request.getParameter("department")
    - Requires that the results can be clickable .... how?
    => Just add a tag <a> on behalf of your department. Example:
    HTML Code:
    <a href="department.jsp?department=<%=num_department%>"><%=name_department%></a>
    When you've done all that, you can finally think url rewriting put in place.
    The principle is simple: it converts a url type http://www.mydomain/listing/depart75/mumbai.dhtml "in" http://www.mydomain/listing/city.jsp?city=num "

    But before putting the system in place already created your application.

Similar Threads

  1. Content Advisor page comes up but can't run certain pages?
    By Elowen in forum Technology & Internet
    Replies: 6
    Last Post: 18-06-2011, 09:24 PM
  2. Retrieve a web page content in java
    By New ID in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 04:09 AM
  3. How to copy content from web page without formatting?
    By bharti_rajpal in forum Technology & Internet
    Replies: 5
    Last Post: 13-01-2010, 05:01 PM
  4. Differentiation between static web page and a dynamic web page
    By Sheena_thakkar in forum Software Development
    Replies: 3
    Last Post: 07-12-2009, 08:21 AM
  5. Update a page content without reload
    By Cabexas in forum Software Development
    Replies: 3
    Last Post: 07-11-2009, 09:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,488,393.17420 seconds with 17 queries