Also talk about the groom, Sohu News system technology, of course, how to use JSP to achieve!!!!!

Source: Internet
Author: User
Tags date file upload html page
Js|sohu| News System I just finished a similar system in two days, hoping to discuss 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.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.