博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JSP常用标签
阅读量:7086 次
发布时间:2019-06-28

本文共 900 字,大约阅读时间需要 3 分钟。

jsp代码:

<%-- 和pageContext.include()一样效果,动态包含--%>	
jsp代码:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>      My JSP 'index.jsp' starting page          
PS:因为web.xml中配置首页只能是jsp, 而首页往往需要servlet处理数据,所以就在首页index.jsp中使用来转发到servlet。

jsp代码:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>      jsp常用标签      	<%		int x = 10;	 %>		
Servlet代码:
public class ServletDemo1 extends HttpServlet {	public void doGet(HttpServletRequest request, HttpServletResponse response)			throws ServletException, IOException {		String username = request.getParameter("username");		System.out.println(username);	}	public void doPost(HttpServletRequest request, HttpServletResponse response)			throws ServletException, IOException {		doGet(request, response);	}}

转载于:https://www.cnblogs.com/coderookie0820/archive/2013/04/26/4367488.html

你可能感兴趣的文章
Spring Boot QuickStart (3) - Web & Restful
查看>>
实现一个spring webservice服务端四:服务端、客户端以及httpclient调用spring-ws服务...
查看>>
使用 nexus 2 搭建 maven 私服及常见配置
查看>>
发布 Android Library 到 JCenter 从入门到放弃
查看>>
FileReader基础
查看>>
QConf搭建配置中心
查看>>
CSS Flexbox学习笔记
查看>>
js删除元素方法
查看>>
yum和apt-get的区别
查看>>
Python全栈之路系列之字符串格式化
查看>>
随手记 - 疯狂触发滚轮事件的Mac触控板
查看>>
Vapor 连接 MongoDB
查看>>
Word Abbreviation
查看>>
数字时代的精益组织
查看>>
腾讯云发布新一代自研云原生数据库CynosDB
查看>>
Mozilla停止对Firefox Hello的支持(采访)
查看>>
DataBinding 的Listview绑定
查看>>
下一代微服务!Service Mesh 2018年度总结
查看>>
火掌柜iOS端基于CocoaPods的组件二进制化实践
查看>>
前端大神用React刻了一个Windows XP
查看>>