• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Hi ranchers,one problem,help me please

 
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my DD with following code:

And my index.jsp


But the output is :

I don't know what happened with my problem ,i am using the NetBeans with GlashFish server and the generated codes following:

Please help me !!!
[ December 27, 2007: Message edited by: Christophe Verre ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This web.xml and this JSP are part of the same application, right ? Everything looks fine, you should be able to get the init param in both cases. Did you set anything special in your JSP, like the page directive ?
 
Zhao zhenhua
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Christophe Verre:
This web.xml and this JSP are part of the same application, right ? Everything looks fine, you should be able to get the init param in both cases. Did you set anything special in your JSP, like the page directive ?


Yes,they are all the same app.My index.jsp has only just one page directive here:

Do you means the pageEncoding is the key?I will try it again!

Thank you very much! Dear Christophe.
 
Zhao zhenhua
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I change the pageEncoding="UTF-8" and it still doesn't work.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Do you means the pageEncoding is the key?I will try it again!


No, I didn't mean that. I thought that you might have set something to prevent EL from working. But it would not have explained why the scriptlet does not get the parameter anyway.

Did you launch the server from NetBeans ? I'm wondering if you have a configuration problem here.
 
Zhao zhenhua
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Did you launch the server from NetBeans ? I'm wondering if you have a configuration problem here.


Yes,I lauch the server GlashFish from NetBeans.I doubt the server has some problems.I have not configure any files...I using the last versin NetBeans6.0
[ December 27, 2007: Message edited by: Zhao zhenhua ]
 
Zhao zhenhua
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Zhao zhenhua:
[QB]
Yes,I lauch the server GlashFish from NetBeans.I doubt the server has some problems.I have not configure any files...I using the latest version NetBeans6.0

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've downloaded NetBeans 6.0 for the fun of it That was very simple to make Glassfish run ! Amazing. Ok, Using the "New Project" menu, I've tried to make a simple "Web Application" looking like yours. In my project, under "Web Pages/WEB-INF", I double-clicked web.xml. There's a nice editor to edit web.xml tags. I chose "Context Parameters", and added one parameter just like yours. In the auto-generated index.jsp, I added your two lines of JSP. I check that web.xml was the same as yours. I launched it, and it worked. I really can't understand why it wouldn't work for you. Or maybe you deployed the application once, modified web.xml, and relaunched without redeploying ?
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your jsp isn't able to resolve the context parameter mentioned in web.xml. Is this file created correctly?

Just check the extension of web.xml, correct. Look in the file if any other error. retsart server.

Vilish
 
Zhao zhenhua
Ranch Hand
Posts: 37
IntelliJ IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vilish S:
Thanks Vilish and all of yours sincerely help!I am trying..

 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried copying just your context-param tag and jsp lines to a test app in Tomcat and everything worked just fine.

I then tried it in NetBeans 5.5.1 (with Tomcat). No problems there either.

In both cases, my web.xml is saying my Servlet spec is 2.4 while yours says 2.5 but that shouldn't be the difference of why this isn't working for you.

Did you create your own web.xml file under a WEB-INF folder or are you simply changing the one that comes in [Files]>web>WEB-INF>web.xml?

By the way, HFSJ recommends NOT using an IDE. You'll learn a lot more about what is really going on if you don't.
[ December 28, 2007: Message edited by: Marc Peabody ]
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic