Tom mmeke

Greenhorn
+ Follow
since Jul 19, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tom mmeke

Kumar Raja wrote:
Also, apart from the above, are there any other ways of managing sessions.



You could extract the HTTPSESSION in your webservice.



When you first call this method you'll receive a response with a "Set-Cookie" parameter in its header.
Copy this value, paste it in the "Cookie" header in your next request, and tataaaa ... counter is 2
1. Every reference to ResourceLoader is static ?
2. Why are you first getting the KeySet, then iterate over the KeySet, to finally request the value from the properties map for each key ?
Why not just iterate the PropertiesMap from the beginning ?
3. Class.forname() expects a classname as parameter (duh), something like 'com.yourpackage.ResourceLoader', and not just the variable you gave an instance of a class ...

Besides, like Tim told you before, you can't expect JSF to give you an entire object as selected value.
Use my previous example, and change valueChanged to this.


Still not sure what your actually trying to achieve with this snippet.
Nevertheless, there is something seriously wrong with your code.
13 years ago
JSF

ns deep wrote:Hi again Tim,

I follwed what you said. I've a Hashmap which has "Key-Label to be displayed" and "Value-The backing bean name". I'm able to retrieve the corresponding name after I select from the drop down. The value received is in the string format. How do I now create an instance of this and call the corresponding class?

Eg. I selected Address, getPropertiesMap().get(event.getNewValue() is giving me the fully qualified name - com.backingbean.Address which is now in string format.

Thanks in Advance





Should look something like this. (Haven't tested it)
13 years ago
JSF
You are missing the point of interfaces ...

The above shows you why the comiler compiles even when you implement the same method multiple times.
The real question is, why are you defining interfaces, if you call the method from the aer class directly anyway ?
13 years ago
Use Interceptors (JEE6).

- Create your own interceptor annotation
- Place this annotation on the methods in your managed bean or any other method (CRUD methods) that you want to log
- Create an interceptor class, and use reflection to log the method that was called, the parameters, etc.
- Configure your application server logging settings so every log from your interceptor class gets stored in a seperate log file.

Interceptors are a very useful tool to create trace logs.


13 years ago
JSF
It depends on what you're trying to achieve.

displays a row for every entry in a SET or LIST.

arranges JSF components in a specified number of columns.
13 years ago
JSF
The whole idea of JSF is to avoid using raw HTML, so JSF can build its own tree of components.
If you use JSF will decide whether to generate this into span or div.
In general, just use JSF tags, and don't worry about what the generated HTML code will look like.

There is one exception though; in your template you can use html tags to design your page.
(eg. make a menu on the left or top)
13 years ago
JSF
You're missing the basic concept of SF and SL.

If you inject (or look up) an SFSB into your backing bean (JSP page), you 'link' these 2 together.
But since your JSP page is requestscoped, you will recieve a 'clean' JSP page everytime you reload your page, ergo it has lost its link, and creates a new SFSB instance.
I have no experience on JSP & EJB2 technology, so i have no right answer to fix this, but i guess you have to store your SFSB reference in your HttpSession ?

As for the SLSB, in EJB3.x SLSB's are pooled, and you'd have to be extremely lucky to hit the same SLSB every single time.
Not sure why it keeps injecting the same SLSB in your example.

PS: As alex stated, please, for the love of god, use JSF & EJB3.x
One of the basic elements of ERP is having a comon database, with several different front-ends mounted on it.
Having a simple webserver, imo, won't serve your needs, and counteracts with the idea of loose-coupling.

My advice is to use JEE6 on a Glassfish or JBoss application server.
- Build an EJB Module using JPA and EJB's.

- Build a web module (or web service, or desktop app, or all three) using JSF/Facelets, CDI and a framework like RichFaces or PrimeFaces or .. any other you can find out there.
- Use maven to provide your EJB module to your front-end.

There you have some names to start with.
If you have no experience with JEE 6, here are 900 pages of fun to start with
http://download.oracle.com/javaee/6/tutorial/doc/gexaf.html

As for AJAX. I know for a fact that richfaces & primefaces have AJAX support, but that's just the ones i worked with.
If you're using a backing bean to get your text, just use string replacement to replace "\n" with "<br />".


Then use escape = false in your outputText field.

* This answer might come a bit late for the OP. But google brought me here, so it might help someone else. *
13 years ago
JSF