js|sohu| Sina | News system
I have just completed such a similar system in the last two days, and I hope to discuss with you the technology of JSP implementation.
Sina Sohu Such a system should be similar, is the background dynamically generate foreground HTML page, no matter what tool backstage.
Because the company forced down, to do such a news system, there is no way, connected to do two days, finally finished, will soon be posted to the company's homepage above
Of course, I only do a background management of things, using Jsp+javabean to dynamically generate HTML files
That's how I realized it.
1, the first to write a good HTM file template, the background with writer object to write files, and then a few need to replace the place such as news headlines, news content directly based on the input to replace the file name on the date such as 2000-12-18-1.htm similar;
2, File upload with jspsmartupload components, mainly used to pass news pictures, and then the generated picture path to replace the template img src tags;
3, the database at the same time to save the title, file name, date and other information, news content and other information is not necessary to retain;
4, the front call directly from the database to take xxx.htm file name, file title on the line;
Plus a few tips, because the Jspsmartupload component does not support file upload renaming, I set up a temporary directory to store uploaded image files, and then write a method to copy the file through IO operation to the specified directory, of course, the name also changed to the corresponding HTM file name. This is to prevent the file from the same name, usually by date or automatically add variables, and other means to name.
Preliminary test, the speed is relatively fast, because the news is static HTM files.
After two days of hard work, we can finally have a little rest tonight:
If you have used JSP to do a similar system, welcome to Exchange.