Go Idea when creating a new JSP project

Source: Internet
Author: User

This article transferred from: https://www.vastyun.com/bloger/670.html

The new JSP page does not have the same page as Eclipse

<%== request.getscheme () + "://" +request.getservername () + ":" + request.getserverport () + path + "/ "; %>

However, when you manually add the above code, you will get an error, Workaround: Add reference Javax.servlet-api-x.x.x.jar to the project. You can refer to the links above for specific ways.

To support EL expressions, you need to reference the Jstl-1.2.jar class library, and then you can write code like this on a JSP page:

<%@ taglib Prefix="C"URI="Http://java.sun.com/jsp/jstl/core" %><C:choose>    <C:whenTest= "${not Empty Sessionscope.user}">welcome you: ${sessionscope.username}</C:when>    <c:otherwise>you are not logged in, please log in first:<formAction= "<%= path%>/login<%= path +"a "%>"method=" POST "> UserName:<inputtype= "text"name= "UserName" /><BR/>Password:<inputtype= "Password"name= "Password" /><BR/>            <inputtype= "Submit"value= "Login" />        </form>    </c:otherwise></C:choose>

Go Idea when creating a new JSP project

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.