Separation of data and presentation
I have HTML js and css web page where users enter some information and every information the user enters is stored in a div tag and when he clicks on the save page, the whole html is saved which contains both the user data and also the presentation. There are as many as 40 div tags which has to saved. The page whic开发者_开发知识库h is save will be made available once the user hits the particular URL say www.mydomain.com/xyz.html that page will be loaded.
I just tried to keep those data in a xml file, but I am saving the whole html page inside the xml page. My next step would be saving only those particular div tags which are dynamic in a xml file and when ever the user hits the url that particular xml file will be reconstructed and displayed.
Is what I am doing is right? or is there any other practice to keep the data and presentation.
BTW its a Java,j2EE based web application.- Have a common template page
- when user hit
www.mydomain.com/xyz.html
parsexyz
and lookup DB for your 40 information pull it into a Bean - now put this bean values on presentation.
精彩评论