由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - JB JAVA Bean,SERVLET位置一问
相关主题
学JavaWeb和J2EE有什么好教材?向各位高手求教,多谢先
jBuiler 4白皮书(来自inprise网站)求java tutor一枚(付费,可网络交流)
JSP/SERVLET里面如何实现弹出窗口(新短信)功能请问公司里用Java主要干啥?
help neededjava certificate
JSP+SERVLET网站一般用下面方式来保存和传递变量和参数谁能refer个湾区的jr, mid level java SDE?
使用JAVA的一则经验和教训理解Java Servlets [fwd]
JSP程序中如何在客户端启动另外的JAR程序新手请教!如何在jbuilder中开发jsp 中,如何更改jsp
JSP一问Please Help!
相关话题的讨论汇总
话题: jsp话题: servlet话题: bean话题: jb话题: import
进入Java版参与讨论
1 (共1页)
p***p
发帖数: 559
1
用JB做一个JSP,SERVLET东西。先建立一个WEB MODULE,JSP存在里面。然后建立JAVA
Bean,SERVLET这些,JB会保存在比如project/src/com/smth/javaweb/
里面。可是在JSP中如果使用com/smth/javaweb的BEAN或者SERVLET老是说找不到。我现在
用土办法,把所有BEAN或者SERVLET打成个JAR文件,然后引入LIB。
请问正确的该如何配置?
w*r
发帖数: 2421
2
If you wish to use those objects, you need import the path. You should know
that JSP is nothing but a 'servlet', basically, the jsp will be translated
into a servlet while it is compiled by the J2EE container. So, it's final
representation is a class.
Import in JSP is: <%@ page import="java.lang.*" %>
Do not forget to put double quotes on the package name.



【在 p***p 的大作中提到】
: 用JB做一个JSP,SERVLET东西。先建立一个WEB MODULE,JSP存在里面。然后建立JAVA
: Bean,SERVLET这些,JB会保存在比如project/src/com/smth/javaweb/
: 里面。可是在JSP中如果使用com/smth/javaweb的BEAN或者SERVLET老是说找不到。我现在
: 用土办法,把所有BEAN或者SERVLET打成个JAR文件,然后引入LIB。
: 请问正确的该如何配置?

p***p
发帖数: 559
3
thanx a lot!!! stuid JB.

MODULE,JSP存在里面。然后建立JAVA


【在 w*r 的大作中提到】
: If you wish to use those objects, you need import the path. You should know
: that JSP is nothing but a 'servlet', basically, the jsp will be translated
: into a servlet while it is compiled by the J2EE container. So, it's final
: representation is a class.
: Import in JSP is: <%@ page import="java.lang.*" %>
: Do not forget to put double quotes on the package name.
:
: 在

c**g
发帖数: 274
4
Is this a special case in JB? he mentioned if he "把所有BEAN或者
SERVLET打成个JAR文件,然后引入LIB" then no problem.
But as I understand, you always need to import the class if you don't want
to use full path name of a class and the compiled JSP is not under
the same package as that of the class you use, no matter you
"打成个JAR文件,然后引入LIB" or not.

【在 w*r 的大作中提到】
: If you wish to use those objects, you need import the path. You should know
: that JSP is nothing but a 'servlet', basically, the jsp will be translated
: into a servlet while it is compiled by the J2EE container. So, it's final
: representation is a class.
: Import in JSP is: <%@ page import="java.lang.*" %>
: Do not forget to put double quotes on the package name.
:
: 在

w*r
发帖数: 2421
5
yes you are right, as long as your jsp page is in the different package,
you should always use import to find the file. em....
I have a question here, I remember that when I use a bean on the page,
I did not import the package, however, for some reason, when i tried use
JBuilder, the bean class can be found automatically by the jsp page.
I think there might be some place in the WEB.xml which could include
a default package for jsp pages.......

【在 c**g 的大作中提到】
: Is this a special case in JB? he mentioned if he "把所有BEAN或者
: SERVLET打成个JAR文件,然后引入LIB" then no problem.
: But as I understand, you always need to import the class if you don't want
: to use full path name of a class and the compiled JSP is not under
: the same package as that of the class you use, no matter you
: "打成个JAR文件,然后引入LIB" or not.

1 (共1页)
进入Java版参与讨论
相关主题
Please Help!JSP+SERVLET网站一般用下面方式来保存和传递变量和参数
想起几年前Re: run servlet from command line?使用JAVA的一则经验和教训
Swing GUI vs JSP Web SolutionJSP程序中如何在客户端启动另外的JAR程序
找在servlet里处理上传文件的包JSP一问
学JavaWeb和J2EE有什么好教材?向各位高手求教,多谢先
jBuiler 4白皮书(来自inprise网站)求java tutor一枚(付费,可网络交流)
JSP/SERVLET里面如何实现弹出窗口(新短信)功能请问公司里用Java主要干啥?
help neededjava certificate
相关话题的讨论汇总
话题: jsp话题: servlet话题: bean话题: jb话题: import