博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
javaEE之hello.java
阅读量:4541 次
发布时间:2019-06-08

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

1 /** 2  * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. 3  * 4  * You may not modify, use, reproduce, or distribute this software except in 5  * compliance with  the terms of the License at: 6  * https://github.com/javaee/tutorial-examples/LICENSE.txt 7  */ 8 package javaeetutorial.hello1; 9 10 11 import javax.enterprise.context.RequestScoped;/*使用请求scope来标识Hello类为管理bean类*/12 import javax.inject.Named;13 14 @Named /*默认bean的类名,可使用@Model来代替*/15 @RequestScoped /*请求scope在web应用程序中的单个HTTP请求期间任然存在*/16 public class Hello {17 18     private String name;/*只有在该类中才能访问name*/19 20     public Hello() {21     }22 23     public String getName() {24         return name;25     }26 27     public void setName(String user_name) {28         this.name = user_name;29     }30 }

 

参考:http://www.cnblogs.com/zgq0/p/8685612.html

 

转载于:https://www.cnblogs.com/cowryw/p/8692422.html

你可能感兴趣的文章
leetcode--Algorithm--Array_Part 1 Easy- 566 Reshape the Matrix
查看>>
AC自动机算法详解 (转载)
查看>>
python3-day5(模块)
查看>>
Linux配置JDK
查看>>
qt 读取xml文件
查看>>
python3之正则表达式
查看>>
Visual Studio提示“无法启动IIS Express Web服务器”的解决方法
查看>>
Java 时间总结
查看>>
jQuery EasyUI 拖放 – 基本的拖动和放置
查看>>
这些年正Android - 母亲
查看>>
[工具] BurpSuite--XssValidator插件
查看>>
LPC1788系统时钟初始化
查看>>
channel vs mutex
查看>>
页面布局(--FlowLayout,--BorderLayout,--GridLayout)
查看>>
实验吧--web--你真的会php吗
查看>>
python中的setdefault()方法
查看>>
转 VSFTP用户权限管控
查看>>
poj2420 A Star not a Tree? 模拟退火
查看>>
微信小程序--登录授权,一键获取用户微信手机号并登录
查看>>
[转载] C#面向对象设计模式纵横谈——13. Proxy代理模式
查看>>