at first I save the text and image in the database ,and in the front-end i use statement to display the text that in web object:
<img src="<%=picturepath %>" width="570" />
<jsp:include page="<%=contentpath %>" />
then in the back-end ,i restart a web project .I use virtual route: D:\site .when read the a.jpg or a.txt ,I can enter
http://localhost:8080/site/a.jpg or
http://localhost:8080/site/a.txt in the IE.
then it show.
I upload the image and text on D:\site with apache , then save the route txt/site/a.jpg and /site/a.txt in Mysql. and with the statement
<img src="<%=picturepath %>" width="570" />
the text and image will display
but
<jsp:include page="<%=contentpath %>" />
this statement can’t display the text
I think it’s because the contentpath is relative path,site and the project in same catalogue. my original opinion is
http://localhost:8080/site/a.txt
but it turn out to be:
http://localhost:8080/webapp/site/a.txt
I hope to know how to display the /site/a.txt that read with the datebase in jsp
merci beaucoup
I build two separate web project for front and back,upload the text on the back-end to the frond-end web project: workspace \ webapp.and front and back share same mysql database,the database store the relative path of image ,then build a virtual route,redeploy the front-end ,the image can show,the text doesn’t .