For mysql-ssh questions about database reading methods and content processing, please answer!

Source: Internet
Author: User
I just learned about ssh and want to write a website. I have several questions to answer. Question 1: I want to display news on the homepage. Currently, I can only read the database content using the following methods. $ {New. event} result :! IMG (img.ask.csdn.netupload201602231456235075_156909.png) I am troubled by the code writing method on the jsp page. Is there any way to automatically obtain a query set when I access the home page. Note: Instead of opening a new page through XX. action, I want to access index. jsp... mysqlsql server for the first time.

I just learned about ssh and want to write a website. I have several questions to answer.

Question 1: I want to display news on the homepage. Currently, I can only read the database content using the following methods.

<%
NewsDao dao = new NewsDao ();
Session. setAttribute ("newlist", dao. queryAllNews ());
%>


/C: forEach

Result:
This method of writing code on jsp pages makes me very difficult. Is there any way to automatically obtain the query set when accessing the home page.
Note: not through XX. action and open a new page. I want to access index for the first time. jsp can read the database content without writing the <%> code on jsp.

Question 2: When the news is opened, when the content is displayed, the content of the article is ugly. how can we save the content of the article and automatically wrap it when it is displayed.
(I can only think of saving it in a line break
And then use XX. innerHtml in js. it may be silly .)

Question 3: What should I do if I want to save the image? Currently, the mysql database is used. (Using sqlserver? Method)

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.