I want to create a blogging like CMS in jsp. So I have a "post.jsp" which will dynamically display the content. I have a database which stores some url pattern and their content.
For example database stores:
url: www.example.com/abc
content: hello
url: www.example.com/xyz
content: world
I want to do that when a user will enter "www.example.com/abc" it will run "post.jsp" and check in database whether the url is present or not. If present then it will display "hello" else 404 error/
Similarly if user will enter "www.example.com/xyz" it will again run "post.jsp" and if the url present then it will display "world" else 404 error.
Every time the url should run "post.jsp" if no extension like html or jsp is present in the url pattern. If a url "www.example.com/contact.jsp" is entered by user then it should run contact.jsp without entering "post.jsp" because the url pattern contains a .jsp extension.
Hope you understand my requirement. How to do this?