jndi的困惑

我对jndi的理解,不就是把代码里的配置文件写到jndi.properties里面么
那在代码里用一个hashmap的方式导入到InitialContext()里跟直接用代码写,感觉区别不大啊,只是使用了某个设计模式吧
我的jndi.properties要写多个配置信息该怎么写呢
比如java.naming.provider.url 我有多个不同意义的url该怎么来写

现在服务器已经做得很方便,象JBoss之类无需写jndi.properties,直接使用context寻找就可以。如果需要配置,可参考相关服务器手册。

有服务器是简单啊,但是我不用服务器呢
还有很多特殊情况用不了呢?该怎么解决这个问题

>但是我不用服务器呢
JNDI是服务器组件功能一部分,不使用服务器,也必须有一个JNDI Server或端口,没有JNDI Server就没办法用JNDI

原来这样的啊~~
我只是用的activemq,然后自己写了一个jndi.properties文件,在程序里就可以使用文件里的东西,看来是activemq做了一些处理才支持的.

至于server什么的,不需要吧,只要写个处理该文件的类就可以了,类似proxool读配置文件一样

I think we all need to follow the engineering thought.
1. first find out your purpose
2. find out the problems to reach your goal
3. find the relative technology.
4. understand in concept level
5. hands on some tutorial or codes.


The OO design is not invented with the clap of fingers.
it can be traced to 1980 already, at least the MVC is not new stuff.

when we are using C to simulate the today's class and we write a framework using pointer to function.
I can say the lazy european and americans cannot never invent sth with a big jump.

but our education doesnt emphasis that. they have never had a systematic way to coach student unluckily plus the materials from Qinhua which is really the worst material in the world.

They explain the computer science but why do they use mathematics to explain that. if people are still confusing about math, then how can they understand the real beef in books.

and we were short of hands on coding experiences to link what the professor blabla in courses.

This is the lethal problem for most of juniors in china.
sigh, we have talent but most of the people are off the route.