• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Multipe values to a init param of servlet in web.xml

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys ,

Is there any way we can pass multiple values to a <init-param > of servlet in web.xml? If yes, how can we achieve this?
thanks
Ani
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try Comma separated then Comma is your delimiter.

Kathir
 
Greenhorn
Posts: 7
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aniruddhaa jadhaoa

You can't pass more than one value to a servlet init parameter. But the best way is to follow the advise of Kathir Renu with comma separator, then you can
handle in servlet code and quick slipt values with StringTokenizer or using another way.
Some like this

<servlet>
<servlet-name>mytest</servlet-name>
<servlet-class>mypackage.myclass</servlet-class>
<init-param>
somevalue1,somevalue2,somevalue3....somevaluen
</init-param>
</servlet>

Regards
Phillipe Lemos
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic