reset password
Author Message
stridhiryu030363
Posts: 37
Posted 17:33 Jan 31, 2012 |

There's a lot I don't understand about this. First I made a pagelist class that contained all the information.  I then attempted to make an servlet that made an index.html in the init function. I initialize an author, the welcome comment as well as the current time the servlet was initialized but I don't know how to give it a path that I can actually save and access via "localhost:8080/wiki/index".

Can anyone describe this to me or tell me where in the book it's explained? In the mean time, I'm going to look through the book till I figure this out.

xliu15
Posts: 24
Posted 17:49 Jan 31, 2012 |

You needn't creat the file. you just save the data into a list just like the guest book. look at the guest book, it almost be the same.

stridhiryu030363
Posts: 37
Posted 17:57 Jan 31, 2012 |

So it's just saving the pathname as a string and just reiterating it in the address when accessed then? If so, how would you go about adding that string onto the address?

Last edited by stridhiryu030363 at 18:01 Jan 31, 2012.
xliu15
Posts: 24
Posted 19:58 Jan 31, 2012 |

create one servlet, all the page will goes to that servlet by :"@WebServlet("/wiki/*"), so all the page start with ../wiki/ will goes that servlet.  it search the request, if the request uri path is new, then create new date and the save the path into your list.  if already exist then redirect to the index

stridhiryu030363
Posts: 37
Posted 20:03 Jan 31, 2012 |

Thanks a lot. I was messing around with that portion for a while and was trying to figure out how that same servlet can look up different paths. Totally forgot about adding that * for universal paths.