General Run Steps and the Solutions of Configuration Error
Before you run the .jsp file, please start the
tomcat
in your laptop.
Find the path of the newest version of apache-tomcat folder, runstartup.sh
in terminal window.open a new page of browser, and type
localhost:8080/[projectName]/[path of the .jsp file]
and go.
Also before you do it, please make sure you have set the project onto your Tomcat server, right-click the tomcat server in the bottom of eclipse, add-remove option, then do it!If there is a error like red dotted line under the
<%
characters, you have to check the status of apache tomcat library.
-First of first, check the status of theServers
named project, if closed, please open it.
-Second, go toPreference - Server - Runtime Environments
, check and edit the source location and recreate a new server for your project.
Several Shits (which I have to eat)!
Object
out
which supports us for printing data with different types.
for example,String str = "hello world"; out.println(str);
JSP declare using
<%!
and%>
to define as universal variables in same page. (Between<body
and/body>
)JSP expression is also in body session, but with following
<br/>
. It can print directly as strings.
The content of this blog is summarized from jikexueyuan JSP courses.