K Karthik

Greenhorn
+ Follow
since Jul 05, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by K Karthik

Thanks Rene. It worked like charm.
15 years ago

Originally posted by Jaikiran Pai:
Try this. If that does not work then post the console logs. We have seen users earlier who have been able to get it working on 4.2.2. If the steps in that wiki does not work for you then we can point you to the appropriate forum links where this has been discussed earlier.



Thanks a ton for such a quick reply. I did the same thing and found that it's not working. But I was wrong. It did work but not the way it works in JBoss 4.0.4.

Say for eg. I mapped "C:\images" to "\myImages". Now, let's say the C:\images directory has "foo.jpg". Now, when I entered http://localhost/myImages it din't work. It showed the usual 404 error page. Instead, when I tried http://localhost/myImages/foo.jpg it works. But in JBoss 4.0.4 it shows the files inside the directory.

Although, it serves my purpose, I would like to know why this happens? Any thoughts?
15 years ago
I have JBoss 4.0.4 GA installed in my local machine. I was able to map to a virtual directory with ease in this version. I added the "docBase" and "path" attribute to the "Context" element in server.xml and it worked like charm. I tried the same in JBoss 4.2.2 and it's not working. No error is being shown but a spurious warning - "WARN [config] unable to process deployment descriptor for context 'null'" is shown.

If anyone has successfully configured a simple virtual directory in JBoss 4.2.2 GA, please share your thoughts.
15 years ago
I was wondering as why javax.persistence.Query class throws NoResultException on calling getSingleResult() or getResultList() when there is no results? Won't it be more logical if they return 'null'? Also, rather than making NoResultException to be caught mandatory, they have made it a runtime exception. Since it is very common for a query to return no results, this should have been made a mandatory exception, if at all they are going to throw it.
I understand a part of what you said. So, in short by calling the size() method you are actually "waking it" up? I haven't mentioned Lazy fetch anywhere. Infact I have a many-to-many mapping between two of my entities which does the eager fetch properly. I am not sure why this is not getting following the eager fetch. I will look into it.
Sorry for replying to a very old post. I had the exact same issue while using the @ManyToOne mapping in my application. I blindly followed your "quick and dirty" way and it worked just like that. Now, I am eager to know as how it worked and what's the issue previously. I was not able to comprehend the reason from the above posts.
Raj,

I am still surprised as to how unmanageable the code can become inspite of having the converter class. Take for instance the same example, to display the user details in the JSP, a Struts ActionForm will have to be pre-populated in an Action class. For this pre-population to happen, a stateless session bean must be called to get the corresponding entity bean after which a series of setters will be called to populate the ActionForm.

The situation is worse for a persisting scenario where the user submits the form. The ActionForm gets populated(thanks to Struts), after which, the form gets passed on to a Session Facade if any where it may get copied to a DTO(again a series of setters and getters). This DTO is then passed to the actual session bean which will then populate the corresponding Entity bean(again a series of setters and getters) and then the bean is persisted. Phew!?

As I am new to EJBs I might be wrong. I am wondering if the Apache BeanUtils will be of any use here. Please pour some light here.
15 years ago
I have an application which has EJB and Struts. There are simple Entity Beans and Session Beans. Say for eg., I have a registration table in the DB that has a username,password, email_id and full_name columns. Now, this table will have an equivalent entity bean say (RegistrationBean). Now, let's say I have a JSP that shows a registration form asking for user details to be entered into the DB. Since these details will be sent the Action class, there should be a struts form (RegistrationForm) to hold all the details. Once I get the form populated I some how call the bean and populate the DB. Things are fine so far. Now, when I need to display the userdetails, say, showDetails.jsp. I will be populating the RegistrationForm with the details of user. This will look like something shown below :

RegistrationForm regForm = new RegistrationForm();
RegistrationBean regBean = getRegistrationBeanFromDB();
regForm.setName(regBean.getName())
regForm.setUserId(regBean.getUserId())
...
...

Ideally, the population becomes a series of getters and setters which becomes ugly if there are lot of columns in the DB. Is there a nice design pattern which could be used here?
15 years ago
Joe,

Thanks a ton! I was thinking of using custom tags but thought that there might be an elegant way to do it. My idea was to use a custom tag that can decide on a parameter whether the element has to be editable or read-only and generate the required HTML. I hope that will simplify a hell lot of the JSP scriptlets that I am using now!

Thanks again!
15 years ago
I have a JSP page that is forwarded from an action form and is then populated with various attributes. There are few users in my webapp and they are classified into different categories. I want to show some fields in my page as editable for some users and for the rest I want to show them as only read-only. The fields can be either a textbox, radio button or a text area. Right now I embed this logic in the JSP page with lots of clustered if and else. Is there a clean way of doing it. Does struts provide a way of doing this neatly? If not, is there a design pattern which I can look up for such a scenario?
15 years ago
Hi! I am a newbie to JSF and I have got some books for that. But I am not sure of what IDEs to use for them so that I can develop the applications easily. I have Sun Studio Creator, but its so massive and highly difficult to understand. Are there any books available for IDEs like Sun Studio creator?
In eclipse are there any plugins for drag-and-drop style development for JSF?
16 years ago
JSF