|
I am doing an assignment for college and have been stuck on a problem for the last 2 days... all articles and forums have led me down a road of despair. I created a javabean and jsp, but when I run it on Tomcat, I get an error that the class cannot be found. What should be so simple is such a pain in my ___. For the love of God please someone help me haha!
*** I am running on TomCat v10 / Eclipse and have also tried just placing the files inside the TomCat dir; .jsp in ROOT and .java in WEB-INF/classes/ ***
>>> ImpDateBean.jsp <<<
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="javabean.CurrentDate"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>JavaBean Training</title>
</head>
<body>
<jsp:useBean id="Date" class="javabean.CurrentDate" scope="session">
<jsp:setProperty name="Date" property="*" />
</jsp:useBean>
<p>
Today's date is: <br>
<jsp:getProperty name="Date" property="date_today" />
</p>
</body>
</html>
>>> CurrentDate.java <<<
package javabean;
import java.io.Serializable;
import java.util.Date;
public class CurrentDate implements Serializable {
private Date date_today = new Date();
private static final long serialVersionUID = 1L;
public CurrentDate() {}
public CurrentDate(Date date_today) {
this.date_today = date_today;
}
public Date getDay() {
return date_today;
}
public void setDay(Date date_today) {
this.date_today = date_today;
}
}
Thank you!
-Josh
|
|
|
|
|

Type Exception Report
Message /ImpDateBean.jsp (line: [11], column: [2]) The value for the useBean class attribute [javabean.CurrentDate] is invalid.
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: /ImpDateBean.jsp (line: [11], column: [2]) The value for the useBean class attribute [javabean.CurrentDate] is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:115)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1373)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1189)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2387)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2439)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2445)
org.apache.jasper.compiler.Node$Root.accept(Node.java:473)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2387)
org.apache.jasper.compiler.Generator.generate(Generator.java:3609)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:257)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:391)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
|
|
|
|
It is a long time since I worked with JSP, but I recall the bean classes had to be stored in the correct location of the web folders. Where is your class file stored in the server? Please show the complete structure.
|
|
|
|
|
You put .class files in the classes folder.
javac your Java file?
Make sure you keep the .class file in its javabean package folder.
../classes/javabean/CurrentDate.class
|
|
|
|
|
Josh Hebert wrote: package javabean;
import java.io.Serializable;
import java.util.Date;
public class CurrentDate implements Serializable {
Can't say what the root directory should be but you must have the following path under that root.
.\javabean\CurrentDate.class
|
|
|
|
|
Dear Team, I have a background in VB6 and VB.Net. I plan to learn java as additional programming language. I would like to know if I already have experience with VB.Net and plan to switch to Java, is it hard or easy to learn this new programming language?
Thank,
Kanel
|
|
|
|
|
Kanel Roath wrote: is it hard or easy to learn this new programming language? Definitely one or the other. But the only person qualified to answer that question is you. Java, like all programming languages, is hard for some and easy for others, and you cannot really tell how hard you will find it until you start learning. One of the best resources available is Oracle's Java Tutorials Learning Paths[^], so take a look and see for yourself.
|
|
|
|
|
Thank for your respond. I just hope that I could learn some experience from any people that learn Java which is used to have VB.Net as a background.
|
|
|
|
|
Well good luck. But you will find the answer much faster by doing what I suggested and looking at the tutorials.
|
|
|
|
|
That question is impossible for anyone other than YOU to answer.
All I can say is the more languages you learn, the more you discover the concepts behind them are all the same. It's the syntax that changes.
|
|
|
|
|
I also feel that the concept is the same too. But I would like to learn about an experience of people whose used to get start with Java which have VB.net from the background. Thank for your answer.
|
|
|
|
|
Why would you even care about someone else's experience when they are NOT YOU?
Sure, you'll find some people that have made that transition, and they could tell you that it was hard or easy, but then what?
They are not you. They don't have your background experience, nor your level of knowledge, nor your thought process when writing code. Their experience is going to be completely useless in answering your question.
The ONLY way to find the answer to your question is if YOU dive in and find out yourself.
|
|
|
|
|
Difference Between VB.NET and Java - Javatpoint
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I followed your link, and found:
Applications built with Java are very secure, robust, fast performing and platform independent. Due to the reusability of the code, programmers do not need to write Java code at every time, instead they can inherit functionality from the base class or we can say that it follows (WORA) Write once read anywhere which means write the code one time and read or call it anywhere in the programming language. So, in this way it reduces the code complexity in programming. Further, it is platform independent which means the developer does not need to create separate applications for different platforms.
Yeah. I am not going to argue against it. This praise of Java may be appropriate to enlighten "Differences between VB.NET and Java" (the page headline). Yet, it does affect how I read and interpret other pages on that web site.
|
|
|
|
|
I put that up instead of "Google java versus vb".
I was first going to post that "java is like c#". And whatever that might imply.
But I liked the reference to "multi-platform".
Sometimes I just post something "positive" as a balance.
(My actually experiences are not relevant in this case).
I also wanted to keep it short.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Kanel Roath wrote: VB6 and VB.Net
VB6 in that is more relevant than the other.
If you have done VB6 for years then you will have an idea of what libraries a programming language might support so that experience can help.
If you have been using Object Oriented concepts in VB6 in a rigorous fashion even for a couple of years then that is going to help. If not then that is going to be a problem. Took me about 18 months to actually get OO when I went from C to C++. Although to be fair these days I see a lot less strict OO in Java (and C#) in enterprise applications versus long ago.
|
|
|
|
|
Instructions:
1. Provide the flowchart, complete code and sample output for all of the questions.
A medium sized company has two types of
employees which are hourly workers and commission workers. Each type of employee
has its own pay code:
Pay Code Employee Type
1 Hourly Worker
2 Commission Worker
The hourly worker is paid RM50 per hour for the first 40 hours he/she works and
"time-and-a-half" (1.5 times the hourly rate of RM50) for each of the hours above 40
hours (overtime hours). The commission worker receives RM500 plus 5.5% of their
weekly sales (e.g. 5.5% of RM1000 is RM55).
You are asked by the company to write a Java program that can determine the salary
for both employee types. The program must implement TWO (2) methods, namely
calculatePayHourlyWorker() and calculatePayCommWorker() to perform
the salary calculations for the respective types of employees. Each of the methods
displays the calculated salary amount.
The input for the program is the pay code and the appropriate information needed to
calculate each employee’s salary based on the pay code. If the pay code entered is a
negative value, the program will terminate. If it is invalid (other than 1 or 2), display
an appropriate error message. The output is the calculated salary, which must be
printed to TWO (2) decimal places.
The format of the input and output is as follows:
The format of the input and output is as follows:
Enter pay code: 1
Enter the number of hours worked: 40
Salary is RM2000.00
Enter pay code: 1
Enter the number of hours worked: 50
Salary is RM2750.00
Enter pay code: 2
Enter the amount of weekly sales: 1000
Salary is RM555.00
Enter pay code: 3
Invalid product code!
Enter pay code: -1
Note: The underline texts are the input to the program
a) Complete the program main() method based on the given description.
b) Complete the calculatePayHourlyWorker() method.
c) Complete the calculatePayCommWorker() method.
You can use this as a guideline:
import java.util.Scanner;
public class SalaryApp {
static Scanner read = new Scanner(System.in);
static int hours;
static double salary;
public static void main(String[] args) {
int paycode;
}
public static void calculatePayHourlyWorker() {
}
public static void calculatePayCommWorker() {
double sales = 0;
}
}
|
|
|
|
|
...and you have a question you forgot to ask?
[EDIT]
DO NOT post your question in multiple forums. Once is enough. You posted the exact same thing in Quick Answers, and even there, you never asked a qeustion.
|
|
|
|
|
Answer:
Go to class.
Listen to teacher.
Read book.
Think about the problem.
Write the code.
|
|
|
|
|
Wouldn't it be nice if they all did that?
|
|
|
|
|
But then there would be one less easy question for me to answer.
|
|
|
|
|
I am trying to follow the Teradata documentation to run a jar file. I have tried both ways manual and eclipse plugins for Teradata.
When I use the plugin and try to deploy the file I see the error " The user does not have the EXECUTE PROCEDURE access to SQLJ.REPLACE_JAR "
When I tried to run the codes manually via Teradata studio I see the error " Java XSP/UDF passed an unacceptable signature. Correct the signature
Can you please tell me what did I do wrong? Can you please share with me any working examples?
Thanks a lot.
modified 27-Jan-22 15:35pm.
|
|
|
|
|
Read the stuff at the top of the page: the Lounge is not for coding questions. Post it here instead: Ask a Question[^]
Ignoring the rules and annoying people you want free help from is not a good idea ...
In addition, when you post your question give us just the relevant code fragments, and paste them directly into the question. Without it, we have no idea what you have tried, and it saves us teh effort of trying to work out which bits of your whole code are important.
The more you help us to help you, the better the answer you can get.
But in this case, you are probably best off talking to Teradata support than a generic development site like this one. They produced the documentation, so they will have a better idea what document you are reading and trying from - we don't even know that!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Chris and team really should create a way for you guys to move these type of posts in the lounge to the Q&A forum. Perhaps dump them into a special directory, etc. Where the user will then get an email to take their question, issue that is most likely not formatted and format it into a proper question/problem.
|
|
|
|
|
Sorry guys, I am new to this platform, I will change the question.
|
|
|
|