vysh srini

Greenhorn
+ Follow
since Apr 25, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vysh srini

Atlast the error is resolved!!! The error was with the usage of RequestDispatcher.forward() method. When we use this method, the contents of the page only gets changed but the url still shows the forwarding page, i.e., if i am in page1.jsp and forwarding to page2.jsp, the contents will show page2.jsp but the url will still show page1.jsp only.

So in my case, the url was still showing the 'LoginController' page, from there when i again try to go to 'LoginController' itself, it shows me an error.

I used response.sendRedirect() instead.
11 years ago
Hi,

Can anyone tell me how to invoke both doGet() and doPost() method of the servlet
11 years ago
This problem still seems to be there . Can anyone help me
11 years ago

Hebert Coelho wrote:I believe thats the problem.

The method is returning /Example when you concat with your Action you will get: "/Example/LoginController" and thats not where your Controller it is.

D:\Netbean Projects\Example\src\java\servlets\LoginController.java




I have already told that I have used getContextPath() like this:

<form id="form1" name="form1" method="post" action="<%=request.getContextPath()%>\servlets\LoginController.java">




Thats why i said that, I think hes package should be:



I use Netbeans IDE. When I open my project through window explorer, the structure of my project will consists of folders like
build, dist, src, web etc.... Inside my 'web' folder, I will be having my jsp pages. Inside my 'src' folder, i will having all my java codings inside the folder 'src\java'. Since i wanted to give the full path, i gave the full path by right cliking my file and looking into its properties .So the 'java' is not the package name, it is the folder name. So my servlet class



is correct(as it should not include the folder 'java')
11 years ago
The return of

request.getContextPath();



is

/Example

11 years ago
The "/LoginController" is present in the following location in my project

D:\Netbean Projects\Example\src\java\servlets\LoginController.java

11 years ago
I have already mentioned the error. the error which I am getting is:

The requested resource (/LoginController) is not available.



The resource is present in my project. no doubt about it.....
11 years ago
I used



But no use, I am getting the same error. I also tried using 'application.getRealPath(servlets\LoginController.java)'. It returns the absolute path. But i need to give only the 'url-pattern' (which is in web.xml) in the 'action' tag(if i am not wrong). So it is also not working. Please help me...

My web.xml is as follows:

11 years ago
Hi all,

I have gone through many topics about this error, but i am not able to arrive at a solution to my problem.

I have a JSP named 'Login.jsp' placed inside a folder called 'LoginPages'. On clicking submit button, it goes to a servlet page named 'LoginController.java' and checks for correct login. If username and pwd matches it goes to the home page, else returns back to the login page itself.

When the username and pwd does not match, it correctly returns back to the login page itself. My problem is, when the username and pwd matches, it gives out this error:

The requested resource (/LoginController) is not available.

But at the first attempt when my username and pwd matches, it works correctly. Only after a wrong entry(uname and pwd not match) it gives out this error. Can anyone tell me why?

My code is as below:


Login.jsp



LoginController.java

11 years ago
Oh ok thanks. Since i am using a tool called SQL Yog to work with MySQL, i rarely use those 'create...' commands to create tables.

Thanks anyway.....

Nicola Garofalo wrote:Quoting from MySql 5.1 ref manual, Paragraph 10.2 Numeric Types


INT (uses 4 byte, i.e. 32 bits) is probably not enough for your phone number's range (up to 2147483647 as previously written)

With UNSIGNED INT your max number could be 4294967295

If it's not enough, though i imagine it is, MySql allows you to use BIGINT datatype. You can store numbers up to 9223372036854775807 (in the signed version)








Thanks. That helped me. Unsigned int was not present. I used 'big int'
Hi,

I am using MySql 5.1. I created a column in table 'phonenumber' with datatype 'int' of length 15. If I enter 9 digit number it is accepting. But if I enter a value directly in the database, it is entering a value '2147483647'.


If I enter details through insert query in my java code, I am getting the following error:

java.sql.SQLException: Out of range value for column 'phonenumber' at row 1.

Can anyone tell me what could be the error
== is used to compare only primitives. Use equals() method to compare wrapper classes and objects. For your code

if(ob3.equals(ob4))

will result in both the Integers to be true