
Java Web
rnclcl
这个作者很懒,什么都没留下…
展开
-
Struts2 学习笔记 —— 01 —— HelloStruts
设置tomcat Window —— Preferences —— MyEclipse —— Servers —— Tomcat —— Tomcat 6.x 设置JRE(JDK包含调试,JRE不包含调试) Window —— Preferences —— Java —— Installed JREs 配置结束后,在试运行配置的tomc原创 2014-01-09 16:19:26 · 1035 阅读 · 2 评论 -
Struts2 学习笔记 —— 08 —— Action接收参数(2)
既然输入的参数总要交给相关的类(域对象)进行处理(执行操作或保存到数据库等), 那为什么不干脆直接将得到的参数付给域对象的相关属性呢 定义一个域对象(Domain Model) package com.demo.struts2.model; public class User { private String name; private String password原创 2014-01-16 10:57:41 · 680 阅读 · 0 评论 -
Struts2 学习笔记 —— 07 —— Action接收参数(1)
JDK配置出现问题可能出现在一下几个地方: 1、Window —— Preference —— Java —— Installed JREs 2、Window —— Preference ——( MyEclipse )—— Servers —— Tomcat —— JRE 3、项目右键 —— Properties —— Java Compiler —— Compiler comliance原创 2014-01-15 11:07:29 · 658 阅读 · 0 评论 -
Struts2 学习笔记 —— 06 —— ActionWildCard 通配符
除了05介绍的的两种方式(普通每个Action都配置的方式 和 动态方法调用DMI)以外, 还有通配符的方式,更易管理,更加简便 项目的结构如下图所示 看一下struts.xml配置文件 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//E原创 2014-01-14 11:03:19 · 730 阅读 · 0 评论 -
Struts2 学习笔记 —— 05 —— ActionMethod
我们配置了这样一个struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> /user_add_success.原创 2014-01-13 15:28:37 · 709 阅读 · 0 评论 -
Struts2 学习笔记 —— 03 —— Action
首先说一个小问题 创建JSP文件的时候,默认的编码格式是ISO-8859-1 在Window —— Preference中,搜索JSP,将Encoding改为Chinese,National Standard 这样,默认创建JSP文件时编码格式就会自动设为GB18130了 下面是Action的介绍: 具体视图的返回可以由用户原创 2014-01-10 18:35:23 · 834 阅读 · 3 评论 -
Struts2 学习笔记 —— 02 —— Namespace
Struts到底干什么用的 —— 把请求跟视图分开 Namespace是命名空间 namespace决定了action的访问路径,默认为"",可以接收所有路径的action namespace可以写为/,或者/***,或者/***/***, 对应的action的访问路径为/index.action,/***/index.action,或者/***/***/index.act原创 2014-01-10 16:08:40 · 985 阅读 · 2 评论 -
Struts2 学习笔记 —— 04 —— Path
首先配置web.xml <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaL原创 2014-01-13 14:34:55 · 884 阅读 · 0 评论 -
Struts2 学习笔记 —— 10 —— Action接收参数时的中文乱码问题
在Struts接收参数时,如果输入中文,那么可能就会出现乱码问题 首先写一个index.jsp <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%> Insert title here 使用DomainM原创 2014-01-20 16:01:07 · 3026 阅读 · 0 评论 -
Struts2 学习笔记 —— 09 —— Action接收参数(3)
Action接收参数的第三种方式是ModelDriven,模型驱动,但这种方式并不常用 struts.xml文件与之前没有变化 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/stru原创 2014-01-17 10:50:00 · 637 阅读 · 0 评论