• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with bean example

 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this code and there is error, i dont get this error meaning, there are quotes closed tags are closed, like
Multiple annotations found at this line:
- Attribute "<%
} else {
%>" has no value
- Missing quotes for attribute value


:shocked:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I find shocking is that people are still using Java code in JSPs at this point. Why are you not employing the JSTL and EL for this?

In any case, I copied the code to my system and it runs just fine on Tomcat 5.5. I suspect that you are not showing us the actual code that is causing the problems.
[ September 03, 2008: Message edited by: Bear Bibeault ]
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh this the full code, i took this code from book JSP, so your talking this isn't right way of using jsp? But then you need to recommend some better book

Here is the bean part
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do i have something wrong with the place of bean file?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would not result in a translation error.

Perhaps it would be best to show us the exact error message that you are getting (be sure to use CODE tags to preserve formatting). I'm still doubting that you are showing us accurate code or error text as the they don't match up,
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now i got different exception and made picture of my web folders layout.
http://img395.imageshack.us/my.php?image=55565115lr8.jpg






 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the following line carefully:

<jsp:useBean id="login" class="LoginTestBean" scope="session" />
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you mean using in class attribute test.LoginTestBean ?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mandlar suurla:
you mean using in class attribute test.LoginTestBean ?


yes. class attribute should fully qualified class name i.e packageName.ClassName
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeha i get the same error when i put there package name, now the path to class should be right. I dont know do i need to configure the web.xml?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you place the class file?
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
classes is under WEB-INF folder its put there automatically as I use MyEclipse it makes the class file from src folder.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not what I asked. Where did you put the class file?
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k here is the full path to class file
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You put your web up under webapps/examples?

That's completely whacked up. What you have done is to mix your web up with the examples web app that came with Tomcat.

It needs to be in own folder directly under webapps (or elsewhere in the file structure), but not mixed up with another application!
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k i made project under C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest

and web acces is from http://localhost/WebTest/WebRoot/loginBean.jsp, but still same error.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the WEB-INF? Until your web app is properly set up, it just isn't going to work.
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is current layout of folders:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot - main dir made by eclipse web project, here are jsp files

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot\META-INF

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\WebTest\WebRoot\WEB-INF - here are classes located, also lib folder, and off curse web.xml
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your WEB-INF must be in the root folder of the web app. You've got it buried one level too deep.

You're just guessing at this point. Please stop and actually read about how to properly structure a web application in the Servlet Specification or the Tomcat docs.
[ September 06, 2008: Message edited by: Bear Bibeault ]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic