Java-ee Learning JSP (1) __jsp

Source: Internet
Author: User

Learn the Java EE I do not know is right is wrong, every day in a disorderly thinking, I do not like the language is not particularly fascinated by the language, the only thing I can be excited is those so-called hackers, oh, this is also I have been learning the basic power of computer.

Java EE is in my study of the foundation of the study on the basis of learning, J2ME not how to connect I touched, but I am more familiar with, but I am not very fascinated, android,symbian,megoo,blackmerry and so on smartphone development is now in full swing, But I don't want to get involved until I'm quite sure. Especially for Java some of the advanced features, design patterns and so must have an essential comprehensive understanding, thorough analysis has a full grasp of it will be good to learn, I do not want to waste time tangled up, really too let me worry about.

I spent a lot of time on C + +, I do not know my decision is not correct, oh, I have been unable to correctly treat their future life, learning things can not concentrate, always distracted to learn the learning that led to the end of nothing to learn ...

Environment Linux Ubuntu 10.04

C + + is a hobby, to insist.

Java EE is now I have to master, must not have any mistakes, can not be in the distraction again.

JSP a few days ago to see a lot of fit HTML mix together:

Reference header file:

<% @page import= "java.io.*"%>

<% @page import= "java.util.*"%>

Declaration declaration:

Insert Code:

<%!

private static int counter;

public void Counterinit () {

counter=0;

}

%>

Output:

<%= "Welcome to visit"%><%counter++;%>

Comments:

<%--shows you the number of visits--%>

<!--<%=counter%>-->

Include directive:

<%@ include file= "filename"%>

Example:

<% @page contenttype= "text/html; charset=gb23212 "%>

<% @page import= "Java.text.SimpleDateFormat"%>

<% @page import= "Java.util.Calendar"%>

<% @include file= "test.html"%>

Page that references the include directive.

<% @include file= "test1.jsp"%>

Test.html

<body>

Ni hao!

</body>

test1.jsp

<% @page contenttype= "text/html;charset=gb2312"%>

<%

Calendar date=calendar.getinstance ();

SimpleDateFormat formatter=new SimpleDateFormat ("mm-dd-yyyy");

%>

<p Align=center><%=formatter.format (Date.gettime ())%></p>

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.