I have a subject that covers JSP(new to me), accessing database through JSP(new to me), applets, UML(also new to me)
So, as im learning java, all i did to learn faster is i've created some applications(wi th sense). With my style of self learning, i hope it could be effective in JSP too....
I like to be advanced on the planned topic to be discussed by our instructor(He is not a certified Java Programmer though)
So now, all i know about JSP is the following:
-basic tags
expression <%= something%>
declaration <%! something%>
i dont know the term <% something %> I think it is an invocation
equivalent to java (Please correct me on that part)
-Setting up tomcat.
-The ROOT folder
-WEB-INF theoritically knew where to put classes/jars etc....
(though im not tested them yet)
-getting the value of a html form through request.getPara meter("form input-type name)
Those are basics obviously...( I learned them through surfing)
And im planning to create a simple application.
What comes on my mind is to reimplement my previous project (Simple Hotel FrontDesk System) into Online Hotel Reservation System
-the registration is obviously done by the hotel frontdesk only....
-Maybe the BlackList feature would be added if i knew the real ( Deep )
Actually, we have proposed a project "Online Entrance Exam" to our instructor and he likes it... so he approved our proposal.....( Not Thesis )
But before we start banging that project, deadline is on October ( Final week in this semester )
I like to grasp the essentials of JSP and also the other techniques, new way, and theory behind that architectural design for web application platform....
(Please correct me on the phrase above)
Actually, the faculty decided to order a J2EE book from Sun( i think the book base is in Singapore) for about 2500php or $56.00
Unfortunately, that book is expected to be arrived on midterms.... unbelievable scenario(but that was true)....
I did attempt to buy a new book instead of waiting that precious book, but i doubt for having such book....(for $40.99)....
So i decided to wait that precious book, yet learning in advance from this forum and the other web resources....
What a long story :)
Well, anyway,
Here is what i suppose to know in JSP as im building my experimental application for the supplement on my final project( Not thesis though )
I like to know about the JSP Beans,
for example, i have a java class that contains setter and getter methods,
i like to jar them, unfortunately, i didn't found the right tutorial for it on the web...
so can you post a helpful url that would teach me how to do that?
and also, about how to access the jar file from the jsp container( doubt of terms )Please correct me....
Or can you show an example?
For example, i have a jar file in WEB-INF/lib/JARZKY.jar
and the content is com\myclass.cla ss(with setSetter() and getGetter() methods)
How can you invoke that class through JSP?
A sincere Java Lover,
sukatoa
35 3658
First read this one.
Then get this one which is free from sun for the more serious stuff.
First read this one.
Then get this one which is free from sun for the more serious stuff.
Thanks for the URL r035198x....
Im on my way.....
Thanks for the URL r035198x....
Im on my way.....
I have created a jar named Checker.jar
saved on WEB-INF\lib\
my problem is i cannot access the Checker.jar
with content dma.Checker.cla ss
i've attempt:
<jsp:useBean id="Checker" scope="page" class="Checker" />
attempting to replace class into jar ==> invalid attribute
But i really have no idea how to fix this.....
Can you show me an example about this?
The url above does only explains how to deal with classes...( not jar )
Is this possible?
I would like to add a text file together with the classes folder inside WEB-INF
And that text-file is the source to be extracted for calculations and i will try to open that textfile from my java-bean.... possible? or not?
for example,
I have a text file that contains the list of all countries....
That is really disapointing on my part that all the countries will be coded on
bean. so i decided not to do it inside the code, instead on the database....
But for that it is just a constant data, having it on the database will add
another table and it will consume another bean that has 100 lines of code
(Approximately) . Before attempting it into database, i need your advice, and
the answer on the above questions experts....
Looking forward on your replies,
sukatoa....
Im currently doing some experiments in JSP........
and I fail to debug my code.....
Here is the stacktrace: - org.apache.jasper.JasperException: For input string: ""
-
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
-
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
-
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
-
-
-
root cause
-
java.lang.NumberFormatException: For input string: ""
-
java.lang.NumberFormatException.forInputString(Unknown Source)
-
java.lang.Integer.parseInt(Unknown Source)
-
java.lang.Integer.valueOf(Unknown Source)
-
org.apache.jsp.home.guests.Validator_jsp.checkAccountInformation(org.apache.jsp.home.guests.Validator_jsp:63)
-
org.apache.jsp.home.guests.Validator_jsp._jspService(org.apache.jsp.home.guests.Validator_jsp:270)
-
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
-
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
-
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
-
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
I am curious about that inputString.... .....
Here is the JSP code. - <%@ page
-
contentType="text/html;
-
charset=iso-8859-1"
-
language="java"
-
errorPage=""
-
-
import = "beans.specific.constants.ImageRefGenerator"
-
import = "beans.reusable.checker.EmailChecker"
-
import = "java.util.ArrayList"
-
import = "java.util.GregorianCalendar"
-
%>
-
<jsp:useBean id="signupcookie" class="beans.specific.cookies.SignUpCookie" scope="session" />
-
-
<%!
-
ImageRefGenerator img = new ImageRefGenerator();
-
String SenderLocation = "http://localhost:8080/home/guests/register.jsp";
-
EmailChecker checkemail = new EmailChecker();
-
ArrayList<String> reminder = new ArrayList<String>();
-
-
private final boolean checkVerification(String confirm,String reference,boolean strict){
-
if(confirm.length()>0){
-
if(!strict)
-
return confirm.equalsIgnoreCase(reference);
-
else
-
return confirm.equals(reference);
-
}else{
-
return false;
-
}
-
}
-
-
private final boolean checkMail(String email){
-
checkemail.resetValue(email);
-
return checkemail.checkStoredEmail();
-
}
-
-
private final boolean checkAccountInformation(String username,
-
String password,
-
String verifypassword,
-
String emailaddress,
-
String verifyemailaddress,
-
String creditcardnumber){
-
boolean confirmer = true;
-
if(username.length()==0){
-
reminder.add("username");
-
confirmer = false;
-
}
-
if(password.length()<6){
-
reminder.add("password");
-
confirmer = false;
-
}
-
if(!checkVerification(password,verifypassword,true)){
-
reminder.add("verifypassword");
-
confirmer = false;
-
}
-
if(!checkMail(emailaddress)){
-
reminder.add("email");
-
confirmer = false;
-
}
-
if(!checkVerification(emailaddress,verifyemailaddress,true)){
-
reminder.add("verifyemail");
-
confirmer = false;
-
}
-
if(Integer.valueOf(creditcardnumber)<16){
-
reminder.add("ccnumber");
-
confirmer = false;
-
}
-
return confirmer;
-
}
-
-
private final boolean checkMemberInformation(String surname,
-
String firstname,
-
String middlename,
-
String homeadd,
-
String birthdate,
-
String gender,
-
String country,
-
String passport,
-
String placeissue){
-
boolean confirmer = true;
-
if(surname.length()==0){
-
reminder.add("surname");
-
confirmer = false;
-
}
-
if(firstname.length()==0){
-
reminder.add("firstname");
-
confirmer = false;
-
}
-
if(middlename.length()==0){
-
reminder.add("middlename");
-
confirmer = false;
-
}
-
if(homeadd.length()==0){
-
reminder.add("homeaddress");
-
confirmer = false;
-
}
-
if(!checkBirthDate(birthdate)){
-
reminder.add("birthdate");
-
confirmer = false;
-
}
-
if(gender.equals("Select")){
-
reminder.add("gender");
-
confirmer = false;
-
}
-
if(country.equals("Select Country")){
-
reminder.add("country");
-
confirmer = false;
-
}
-
if(passport.length()==0){
-
if(placeissue.length()>0){
-
reminder.add("passportnumber");
-
confirmer = false;
-
}
-
}else{
-
if(placeissue.length()==0){
-
reminder.add("placeissue");
-
confirmer = false;
-
}
-
}
-
return confirmer;
-
}
-
-
private final boolean checkContactInformation(String landline,
-
String mobile,
-
String fax,
-
String alteremail){
-
boolean ret = true;
-
if(landline.length()!=0||mobile.length()!=0||
-
fax.length()!=0||alteremail.length()!=0){
-
if(alteremail.length()>0){
-
if(!checkMail(alteremail)){
-
reminder.add("alteremail");
-
ret = false;
-
}
-
}
-
}else{
-
reminder.add("nonecontactinfo");
-
ret = false;
-
}
-
return ret;
-
}
-
-
private final boolean checkBirthDate(String data){
-
String month = data.split("-")[0];
-
Integer day = Integer.valueOf(data.split("-")[1]);
-
Integer year = Integer.valueOf(data.split("-")[2]);
-
boolean ret = true;
-
-
if(month.equals("February")){
-
if(new GregorianCalendar().isLeapYear(year))
-
ret=day>28?false:ret;
-
else
-
ret=day>29?false:ret;
-
}
-
-
if(month.equals("April")||month.equals("June")||month.equals("September")||
-
month.equals("November"))
-
ret = day==31?false:ret;
-
return ret;
-
}
-
-
private final void VoidVerification(){
-
reminder.add("remoteuser");
-
}
-
%>
-
-
<%
-
signupcookie.resetInstance();
-
-
String username = request.getParameter("username");
-
String password = request.getParameter("password");
-
String checkpassword = request.getParameter("checkpassword");
-
String emailaddress = request.getParameter("emailaddress");
-
String checkemail = request.getParameter("checkemail");
-
String creditcard = request.getParameter("creditcard");
-
-
String surname = request.getParameter("surname");
-
String firstname = request.getParameter("firstname");
-
String middlename = request.getParameter("middlename");
-
-
String month = request.getParameter("month");
-
String day = request.getParameter("day");
-
String year = request.getParameter("year");
-
String gender = request.getParameter("gender");
-
String homeaddress = request.getParameter("homeaddress");
-
String companyaddress = request.getParameter("companyaddress");
-
-
String country = request.getParameter("country");
-
String passportnumber = request.getParameter("passportnumber");
-
String passportissue = request.getParameter("passportissue");
-
-
String landline = request.getParameter("landline");
-
String mobile = request.getParameter("mobile");
-
String faxnumber = request.getParameter("faxnumber");
-
String altermail = request.getParameter("altermail");
-
-
String confirmation = request.getParameter("confirmation");
-
String ref = request.getParameter("ref");
-
-
signupcookie.setUsername(username);
-
signupcookie.setEmailAddress(emailaddress);
-
-
signupcookie.setSurname(surname);
-
signupcookie.setFirstname(firstname);
-
signupcookie.setMiddlename(middlename);
-
signupcookie.setBirthDate(month,day,year);
-
signupcookie.setGender(gender);
-
signupcookie.setHomeAddress(homeaddress);
-
signupcookie.setCompanyAddress(companyaddress);
-
-
signupcookie.setCountry(country);
-
signupcookie.setPassportNumber(passportnumber);
-
signupcookie.setPassportIssue(passportissue);
-
-
signupcookie.setLandline(landline);
-
signupcookie.setMobile(mobile);
-
signupcookie.setFaxNumber(faxnumber);
-
signupcookie.setAlterEmail(altermail);
-
-
String validValue = img.getValue(ref);
-
-
boolean indicator = true;
-
String brtdate = month.concat("-"+day).concat("-"+year);
-
-
-
if(!checkAccountInformation(username,password,checkpassword,
-
emailaddress,checkemail,creditcard)){
-
indicator = false;
-
}
-
if(!checkMemberInformation(surname,firstname,middlename,homeaddress,brtdate,
-
gender,country,passportnumber,passportissue)){
-
indicator = false;
-
}
-
if(!checkVerification(confirmation,validValue,false)){
-
VoidVerification();
-
indicator = false;
-
}
-
-
if(!indicator){
-
response.sendRedirect(SenderLocation);
-
}
-
%>
-
Im loosing hope with this problem.....
Im using DreamWeaverMX, manual set-up of Apache Tomcat........
Can you experts tell me where is it on the code?
Or can you suggest any alternatives for this?
waiting,
sukatoa
Im always late to realize........ .
ArrayList indexOf(Object o) uses the equals method that can't be used to compare null values........
Gotcha!!!!!!! - final boolean hasReminder(String exists){
-
boolean ret = false;
-
reminderloop:
-
for(String rem:reminder){
-
if(rem.equals(exists)){
-
ret = true;
-
break reminderloop;
-
}
-
}
-
return ret;
-
}
I wonder what implementation did lastIndexOf method used in ArrayList?
Is that only uses the reverse value arrangement then apply the indexOf method?
JosAH 11,448
Recognized Expert MVP
I wonder what implementation did lastIndexOf method used in ArrayList?
Is that only uses the reverse value arrangement then apply the indexOf method?
If you wonder how those standard classes implemented things go to your jdk
directory and find the file src.zip. It's a zip file that contains all the source code
files for all the publicly available classes in your Java installation.
kind regards,
Jos
Just a quick,
I've planned to implement all the necessary validations using JSP,
Now, may i know what are the disadvantages of doing such thing?
except for the passing parameters?( takes a little bit of time ) through form.....
Unlike JS, that it runs on the browser as it validates the form just in time.......
ajos 283
Contributor
Just a quick,
I've planned to implement all the necessary validations using JSP,
Now, may i know what are the disadvantages of doing such thing?
except for the passing parameters?( takes a little bit of time ) through form.....
Unlike JS, that it runs on the browser as it validates the form just in time.......
I think by validations you mean form validations? I normally do it in the client side as well as in the server side(just to be doubly sure, and thats the way it should be :)). I dont see it as a disadvantage because those are the things a web developer should do, lets say what happens when a ignorant(or any user) turns the javaScript off in the browser? I as a web developer ensure that the user doesnt skip the mandatory things that he needs to fill. I dont think that it comes down to performance, its a securuty thing for me.
regards,
ajos
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Philip Ronan |
last post by:
OK, here's my 2p worth:
===
Q. Why am I getting the error message 'Headers already sent'?
A. PHP produces this error message when you try to set a header for a web
page after you have already started sending out the content of the page.
Web content is always delivered with a few headers at the top, ending with a
blank line. For example, a web page might start like this:
|
by: soni29 |
last post by:
Hi,
I'm going to be starting a project with a friend of mine in C#, we're
doing it to learn the language a little better, to get more experience
with it. We've already come up with an idea of the application to
build, but need advise on how to get started, to share the work? Also
if there are free servers available with sourcesafe, so we can use
that, and just any basic advise on getting started, how to split work.
Thank you.
|
by: cara_little |
last post by:
Good Morning,
I'm trying to get started with the Enterprise Library to evaluate it
and recommend to the rest of the developers in the company. However,
I'm having a heck of a time getting started and must be missing
something. All of our development is completed in VB. I have installed
Enterprise Library on my machine - however I can't compile the project.
Is the code only available in C#? which means I have to have C#
installed just to...
|
by: tamdino |
last post by:
Please accept my apologies if I am posting this in the wrong place. I
am trying to get started using MySQL-Front and I am totally lost. Does
anyone know where there is a tutorial for getting started with this
interface?
Thanks,
Tammy
|
by: Bibby |
last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled
in C, C++ and VB6. Which would be the best language to focus my attention to
regarding the following considerations:
Hireability
Portability
Flexibility
The likely candidates seem to be Java, VB.Net, C, C++, C#.
| |
by: Jack Duijf |
last post by:
Hello,
I am looking for a person in The Netherlands that is willing to help me
getting started with Vb.net. Please send a message to jack@aicn.nl if you can
help me getting started with the Microsoft Developement Enviroment.
Thanks,
|
by: =?Utf-8?B?Q29kZVNsaW5nZXI=?= |
last post by:
I plan to build my own 2008 Server/Hyper-V system and will not be using one
of the tested Dell or HP systems from the release notes and could use some
pointers as to my assumnptions and answers to a few questions.
Some getting started with Hyper-V assumptions. Please tell me if I am off
base here.
1. Any recent Intel quad core processor has the needed x64 architecture with
hardware assisted virtualization and data execution protection...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |