Where to place javabeans in tomcat
I have a problem finding my javabeans in apache tomcat 4. I have a project with jsp pages in a folder called crm. I have made some java beans which is in com.xxx.crm.beans package (folders). these folders (package) is placed in the crm folder and in my jsp page I use this code:
<jsp:useBean id="ValidationBean" scope="session" class="com.xxx.crm.beans.ValidationBean" />
<jsp:setProperty name="ValidationBean" property="*" />
what am I missing out? I have also tried to restart tomcat. Do I have to place javabeans in the appservers classpath?
Structure:
crm/
login.jsp
crm/com/xxx/crm/beans/
validationbean.class
thanks in advance.
nicolai
thx :)
I still run into problems. I have made the WEB-INF/classes folder and placed my folders and classes (com.xxx.crm.ValidationBean) in the project (jsp) folder. The message I get is:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /crm/login.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:42: cannot resolve symbol
symbol : class ValidationBean
location: class org.apache.jsp.login_jsp
ValidationBean ValidationBean = null;
^
An error occurred at line: 1 in the jsp file: /crm/login.jsp
Generated servlet error:
C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:44: cannot resolve symbol
symbol : class ValidationBean
location: class org.apache.jsp.login_jsp
ValidationBean = (ValidationBean) pageContext.getAttribute("ValidationBean", PageContext.SESSION_SCOPE);
^
An error occurred at line: 1 in the jsp file: /crm/login.jsp
Generated servlet error:
C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:47: cannot resolve symbol
symbol : class ValidationBean
location: class org.apache.jsp.login_jsp
ValidationBean = (ValidationBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ValidationBean");
^
3 errorsValidationBean code:
package com.xxx.crm;
import java.io.*;
import java.lang.*;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import com.mysql.jdbc.*;
// bean class
public class ValidationBean implements Serializable {
protected String username;
protected String password;
protected boolean validUser = false;
private boolean isValidated = false;
// constructor
public ValidationBean() {
}I use Borland JBuilder 8 Personal, and have compiled it there.
Similar Messages
-
Where to place Servlets in Tomcat 4.0?
I just recently installed Tomcat on Win2000 and came across a little problem.
What is the directory in Tomcat 4.0 to place servlets in?
They seem to work fine if they are in 'examples' or in a package within the 'examples'-folder but they do not seem to work from ROOT or WEB-INF.
I tried creating a 'classes'-folder inside of 'WEB-INF'.
I have been trying to invoke them e.g. like this:
http://127.0.0.1:8080/servlet/test4.HelloWorldExample (where test4 is the package name)
I have re-started Tomcat everytime after changing something.
Where do you normally keep your servlets and how do you view them?
I would greatly appreciate a couple of real life examples.
Thanks in advance.Are you sure that Tomcat is running properly? First
try http://localhost:8080
That should give you a Tomcat default page; otherwise you might have to check your classpath.
I just recently installed Tomcat on Win2000 and came
across a little problem.
What is the directory in Tomcat 4.0 to place servlets
in?
They seem to work fine if they are in 'examples' or in
a package within the 'examples'-folder but they do not
seem to work from ROOT or WEB-INF.
I tried creating a 'classes'-folder inside of
'WEB-INF'.
I have been trying to invoke them e.g. like this:
http://127.0.0.1:8080/servlet/test4.HelloWorldExample
(where test4 is the package name)
I have re-started Tomcat everytime after changing
something.
Where do you normally keep your servlets and how do
you view them?
I would greatly appreciate a couple of real life
examples.
Thanks in advance. -
Where to place javabean classes
Put these classes in WEB-INF/classes and enable dynamic reloading. To do that-
open krededit-> SOFTWARE-> iplanet-> Application Server->6.0->CCS0->SYSTEM_JAVA->Versioning and set it to 0. Bydefault it is 1, disabled. And restart the iAS to pickup this change.
Or, redeploy the application.
Hope this would help.
Should you have any question further, get back.
Thanks,
Rakesh. -
Where to place HTMl files in tomcat while executing Servlets examples ?
Hi,
I'm learning servelets (HttpServlets). in that input is given through html files.now i dont know where to place that html file in apache tomcat server
This is my Directry Structure
Java's ---- C:\Program Files\Java\jdk1.5.0\bin
Tomcat's--C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ThreeParams extends HttpServlet
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Reading Three Request Parameters";
String docType ="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +"Transitional//EN\">\n";
out.println(docType +"<HTML>\n" +"<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +"<BODY BGCOLOR=\"#FDF5E6\">\n" +"<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +"<UL>\n" +" <LI><B>param1</B>: "+ request.getParameter("param1") + "\n" +" <LI><B>param2</B>: "+ request.getParameter("param2") + "\n" +" <LI><B>param3</B>: "+ request.getParameter("param3") + "\n" +"</UL>\n" +"</BODY></HTML>");
}HTML code ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Collecting Three Parameters</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<H1 ALIGN="CENTER">Collecting Three Parameters</H1>
<FORM ACTION="ACTION="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\root\WEB-INF\classes.ThreeParams">
First Parameter: <INPUT TYPE="TEXT" NAME="param1"><BR>
Second Parameter: <INPUT TYPE="TEXT" NAME="param2"><BR>
Third Parameter: <INPUT TYPE="TEXT" NAME="param3"><BR>
<CENTER><INPUT TYPE="SUBMIT"></CENTER>
</FORM>
</BODY></HTML>
{code}
servlet code is compiling without any errors, now where should i place the class file and html file in tomcat to execute this program..webapps\yourapplicationname\WEB-INF\
-
Using javabean in tomcat(unable to compile class)
Hello, I am using jakarta-tomcat-5.0.28, OS:WinXP
I am getting the following error when i use javabean in tomcat (the example is executed just fine in another web server:Blazix)
I am very new to this (JSP, Servlets and tomcat) so any help would be greatly appreciate.
THE ERROR IS:
==============================================================
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:42: cannot resolve symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
UserData user = null;
^
An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:44: cannot resolve symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
user = (UserData) jspxpage_context.getAttribute("user", PageContext.SESSION_SCOPE);
^
An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:46: cannot resolve symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
user = new UserData();
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
===============================================================
ERROR END
I use the folowing files:
GetName.html
SaveName.jsp
NextPage.jsp
UserData.java
My Dir Structure is:
/JSPSession
GetName.html
SaveName.jsp
NextPage.jsp
/WEB-INF
/classes
UserData.java
UserData.class
/libThe Code for the files is:
GetName.html
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>---------------------------------------------------------------------------------------------------
SaveName.jsp
<jsp:useBean id="user" class="UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
<A HREF="NextPage.jsp">Continue</A>
</BODY>
</HTML>-----------------------------------------------------------------------------------------------------
NextPage.jsp
<jsp:useBean id="user" class="UserData" scope="session"/>
<HTML>
<BODY>
You entered<BR>
Name: <%= user.getUsername() %><BR>
Email: <%= user.getEmail() %><BR>
Age: <%= user.getAge() %><BR>
</BODY>
</HTML>------------------------------------------------------------------------------------------------------------
UserData.java
public class UserData {
String username;
String email;
int age;
public void setUsername( String value ) {
username = value;
public void setEmail( String value ) {
email = value;
public void setAge( int value ) {
age = value;
public String getUsername() { return username; }
public String getEmail() { return email; }
public int getAge() { return age; }
}A very common question. Tomcat dislikes classes which are not packaged. So, add a package statement in your UserBean.java
package beans; // or something like thatand then place the compiled class file UserBean.class into WEB-INF/classes/beans.
Put the import statement into the JSP accordingly and try again.
***Annie*** -
Hi, my Mac Book Pro 15 inch lap top if i set it on the couch no matter where I place it slips off and luckily so far I have caught it before it falls onto the floor and gets ruined, of which I am super afraid of, due to what I initially paid for it as the consumer. Also, the couch is not made of slippery material at all. Also, when using it on my lap while watching tv, and multi tasking while doing my college homework, it even slides off of my lap at times. Why is it called a lap top then when it's not working as one? Are we to wear rubber pants that grip your products? Also, Why do you place on your Apple website that in one area a satin cover is available in the teal color, and then in another area it's discontinued? I believe it would be simpler if Apple would just remove the product all together from the purchasing website once any product becomes discontinued. Also, I was sitting here at home waiting for a reply about the satin cover in teal no longer being available period or that it has shipped, but yet I ended up calling Apple altogether myself and finding this all out that the only available color is the black. It would've been nice to have recieved an e-mail or a phone call on why it wasn't going to be shipped, or shipping instead of having to do customer services job and doing the leg work myself. Also, why is it that no one also even tells a consumer about the classes that were offered to a new consumer for 14 days after purchase of paying the $99.00s to learn about their macs of any kind? If I had known about such a program, I surely would've signed right up for it. Now I am being told that I can only take one clas at a time or something?!? I seriously wish I was told about this as a consumer of the Mac Book Pro 15 inch, because I would've purchased that offer right away, and now I am stuck and can no longer do it. Also I have had my computer since October of last year. So, I am in college as becoming a graphic designer within a degree of an Associates of Science and am now still struggling to learn the computer, and the programs I pruchased as well at the time of purchase, along with an Epson printer, the magic mouse, and the one year warranty. As for this all, I do believe that Apple needs to make a better bottom to the Mac Book Pro's within a much better quality for the price we pay as consumers, and all other lap tops and/or Notebooks in making them slide proof. The tiny rubber spots on the bottom of the lap tops or any Apple computer similar to mine just needs a better quality improvement to us consumers I spent good money on this purchase, I think now I deserve a rubberised protective cover for free for the slipperyness, and also since I was never told about the program for the classes of which a consumer was to pay $99.00s for, I think as a good paying quality consumer for Apple's products, I now deserve these classes for free as well.
Sincerely,
KimHi shldr2thewheel,
it has been a while since we have last spoke, I would like to let you know, I am still working on getting used to the switch from windows to a Mac/Apple system. I do have a new question for you, I did purchase In Design CS5.5 through journeyed.com through Cuyahoga Community College of which I attend as a student, is there a way to purchase an online book through iTunes to learn that as well? Also, you know me, the struggling student, I would also, when and if the book can be purchased through the iTunes, would need to know if you do know of a much easier book for struggling students like myself and at a reasonable price as well for the In Design CS5.5 program. Our campus bookstore had closed early, and, so did the colleges library and our local library here where I do live, so, I cannot go to either place to purchase a book or to take out a book, plus cash funds are low at this moment as well but, I do have money left on the iTunes account to use, if it can be used. So, can it be used, the iTunes money, towards finding a low priced online book? I am in great need of assistance as I have a project due for my one course for this Tuesday, September 4, 2012.
Sincerely in need of help once again,
Kim -
How do I get an image to stay where I place it without pinning it?
Whenever I place my logo in the top left corner it winds up in the middle. Not sure why this is doing this but I can correct this error if I pin it. Then it stays exactly where I place it, but then it does not scrolll with the rest of the page, because it is pinned. Thank you!
Hi Russ,
Ideally, Image should stay where you placed it. Please send your .muse file to [email protected], add this forum link and refer it to me.
Regards,
Aish -
Where to place ORDER BY clause when a query includes UNION
I have a query that has UNION in it. could you please tell me where to place the ORDER BY clause. Because it's throwing an error if i place the ORDER BY clause at the end
Because you are using the UNION set operator, you need to either specifically list your columns or use positional notation.
Without a set operator we can order by the column name without specifically listing it:
SQL> select * from dual
2 order by dummy;
D
X
1 row selected.This doesn't work once you introduce a set operator:
SQL> ed
Wrote file afiedt.buf
1 select * from dual union all
2 select * from dual union all
3 select * from dual
4* order by dummy
SQL> /
order by dummy
ERROR at line 4:
ORA-00904: "DUMMY": invalid identifierSo you need to either use positional notation:
SQL> ed
Wrote file afiedt.buf
1 select * from dual union all
2 select * from dual union all
3 select * from dual
4* order by 1
SQL> /
D
X
X
X
3 rows selected.Or, specifically list or alias the columns you are projecting:
SQL> ed
Wrote file afiedt.buf
1 select dummy from dual union all
2 select dummy from dual union all
3 select dummy from dual
4* order by dummy
SQL> /
D
X
X
X
3 rows selected.
SQL> ed
Wrote file afiedt.buf
1 select dummy as d from dual union all
2 select dummy as d from dual union all
3 select dummy as d from dual
4* order by d
SQL> /
D
X
X
X
3 rows selected.cheers,
Anthony -
From where can we dowload Apache tomcat and how to install
From where can we dowload Apache tomcat and how to install
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/index.html
-
Marking green screen video to know where to place background images
My students want to create short green screen movies using a number of background photos that will change as they talk about their topic. How can they mark their green screen video so they will know where to place each photo? We are using iMovie 11. Thanks
If that's the case. You don't need green screen at all.
You can shoot the students framed in such a way as to allow room for the photos and then use Picture in Picture.
Here's a how-to from the MacMost site. It's for iMovie '09 but is essentially the same for iMovie '11.
http://macmost.com/imovie-picture-in-picture.html
Post back if you have further questions.
Matt -
Where to place the third party jars on WLS 7.0SP2
Our application use the thirdparty JDBC driver, for example, the JDBC driver for
mySQL. I donot want my customer to modify startWeblogic.cmd or some file else
to make the jar file available for the applicaiton.
my question is if some directory exists under weblogic700/server where I can place
the jar file(that is, like the installed extension of JDK or JRE).
I try to place the jar file on server/ext, it does not work.
Guofeng"Guofeng Zhang" <[email protected]> wrote in message
news:[email protected]...
>
Our application use the thirdparty JDBC driver, for example, the JDBCdriver for
mySQL. I donot want my customer to modify startWeblogic.cmd or some fileelse
to make the jar file available for the applicaiton.
my question is if some directory exists under weblogic700/server where Ican place
the jar file(that is, like the installed extension of JDK or JRE).
I try to place the jar file on server/ext, it does not work.
GuofengDisclaimer: I am a newcomer to the world of BEA WLS,
so try this at your own risk.
For the 3rd party classes to be found, they have to be included somewhere
in the CLASSPATH. The best place (IMO) for customisation of the CLASSPATH
is in the extEnv.sh. You will not find it in a standard installation of
WLS, but if you look in $WL_HOME/server/bin/startWLS.sh you will see this:
PATH=".${PATHSEP}${WL_HOME}/server/bin${PATHSEP}${JAVA_HOME}/jre/bin${PATHSE
P}${JAVA_HOME}/bin${PATHSEP}${PATH}"
# Import extended environment
if [ -f extEnv.sh ]; then
. extEnv.sh
fi
Note the inclusion of "." at the start of PATH. This is magic that enables
the ". extEnv.sh" command to locate the "extEnv.sh" script.
In "extEnv.sh" you can use the EXT_PRE_CLASSPATH, EXT_POST_CLASSPATH,
EXT_PRE_PATH, EXT_POST_PATH and LD_LIBRARY_PATH to add additional classes
and directories to the server environment.
For additional information, refer to the WebLogic Server Administration
Guide (http://e-docs.bea.com/wls/docs70/adminguide/startstop.html).
Similar, if you look in $WL_HOME/server/bin/setWLSEnv.sh you will see this:
PATH="${WL_HOME}/server/bin${PATHSEP}${JAVA_HOME}/jre/bin${PATHSEP}${JAVA_HO
ME}/bin${PATHSEP}${PATH}"
export PATH
# Import extended environment
if [ -f extEnv.sh ]; then
. extEnv.sh
fi
Note the missing "." in the PATH. This effectively means that even if
the "extEnv.sh" script exists in the current directory, then ". extEnv.sh"
command will only look along the PATH for the "extEnv.sh" script! To me,
that looks like an error (probably caused by a DOS-programmer used to
the default behavior in DOS to always look in the current directory
regardless of the setting PATH), so as part of my localised installation
procedure, I replace the offending part of setWLSEnv.sh with:
# Import extended environment
if [ -f extEnv.sh ]; then
. ./extEnv.sh
fi
which forces the "." command to read the "extEnv.sh" file in the current
directory, regardless of the setting of the PATH variable. I have
notified BEA of this, but their responses is that it is per design!
Regards,
Jan Bruun Andersen -
Can I specify the location where iTunes places ripped mp3's?
I would like to use iTunes to rip my CD's.
However:
1. I keep my music at a different location (directory tree arranged by genre, artist, albums etc) than the iTunes library. I manage the music library myself.
2. I edit the MP3 tags outside of iTunes (using MP3TAG software).
So, can I
1. tell iTunes the directory where to place the ripped mp3's and
2. prevent iTunes from automatically integrating the rips into its library. I will import the mp3's into iTunes when I an good and ready.Aloke wrote:
I would like to use iTunes to rip my CD's.
However:
1. I keep my music at a different location (directory tree arranged by genre, artist, albums etc) than the iTunes library. I manage the music library myself.
2. I edit the MP3 tags outside of iTunes (using MP3TAG software).
So, can I
1. tell iTunes the directory where to place the ripped mp3's and
Not really. iTunes places rips at *<iTunes Media Folder>\(Music\)<Album Artist|Artist>\<Album>\## <Track>.<ext>*. You can change the location of your *<iTunes Media Folder>* but that's it. The optional Music\ bit depends on whether you're using the new *iTunes Media Organsiation*.
2. prevent iTunes from automatically integrating the rips into its library. I will import the mp3's into iTunes when I an good and ready.
Nope. iTunes add files to the library as part of any import, rip or play operattion.
For what it's worth I keep my library organised manually, but why use MP3Tag to edit data that can just as easily be editied inside iTunes? After I rip an album or purchase from iTunes/Amazon I use iTunes to amend the details so that the album will be properly organised (see tips at http://www.samsoft.org.uk/iTunes/grouping.asp) and then use MediaMonkey to reorganise the files & folders to my style. I then simply delete & reimport the album.
tt2 -
Not sure where to place my question but I'm having problems installing iwork 9.0. My MacBook Pro doesn't read the disk and ejects after a minute. I just bought the mac and iwork. Any thoughts?
https://discussions.apple.com/community/iwork
-
When I ask siri where a place is (ex: dunkin donuts) she won't say "I found 3 places near you" she won't say anything. It will just show the places. This has been happening since the ios 6 update. Please help
When I ask siri where a place is (ex: dunkin donuts) she won't say "I found 3 places near you" she won't say anything. It will just show the places. This has been happening since the ios 6 update. Please help
-
CS6 64bit Illustrator - win, where to place scripts
HI all,
I just got CS6, and I can't figure out where to place all of my scripts. In CS4 version, once the scripts where in the correct folder, they would show up in the the scripts list,. In CS6, I have to keep finding them. Any help would be great.Karleen1977,
We're you ever able to resolve this issue?
Carlos - For me, the issue isn't installing the scripts in the Script menu. It's the fact that in CS6 Illustrator doesn't remember the location of the scripts when you use Cntrl+F12 or select "Other Scripts" from the scripts menu. It reverts to the root C: drive every time I try to get to my "other scripts". This is a new behavior in CS6, as CS5 always remembered the last folder location when selecting "Other Scripts".
I need to be able to hit "Cntrl+F12" and have it remember to load the last folder I used for scripts, so I we don't have to waste a ton of time browsing to the folder location just to run a "time-saving" script.
Anyone have any ideas with this?
Maybe you are looking for
-
How do I stop duplicate iMessages for two phones.
My husband and I have an iPhone. We have one Apple ID that appears to be registered on both phone. When we sent iMessage to each other we get a duplicate text sent to each of us. How do I stop this?
-
From an online survey I'm pessimistic.
-
A good design for a single thread pool manager using java.util.concurrent
Hi, I am developing a client side project which in distinct subparts will execute some tasks in parallel. So, just to be logorroic, something like that: program\ \--flow A\ \task A1 \task A2
-
Adobe Acrobat Professional and Adobe Reader
I have Adobe Acrobat Professional 7.0 (AP) and Adobe Reader 9 (AR) installed on a WinXP system. Both AP and AR work, but if one is open I cannot start the other: If AP is open and I try to open a pdf file in AR (right click -> open with... -> Acrobat
-
DELETE button not active in Invoice
Hi All, We have ECC 6.0 and SRM 5.0 . After creating Invoice in SRM front, User keeps the Invoice in HELD or posts it with errors when it goes into "TO BE CORRECTED MANUALLY" status. Now when the user agains views it in display mode, only CHANGE but