| Author |
Query on GenericFactory
|
Nikhil Bansal
Ranch Hand
Joined: Jan 24, 2005
Posts: 60
|
|
Hi All,
I am new to Struts and need some help.
I have a piece of code
ReferBackStatusBaseUI st = (ReferBackStatusBaseUI)GenericFactory.getInstance("referBackStatus");
I wanted to understand where referBackStatus is being maintained. Is it being maintained in some XML or some properties file.
The thing is that the object st is referring to a few buttons and I would like to change their labels.
Please if someone can help.
Thanks,
Nikhil
|
ban$al
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8260
|
|
|
There is no class named GenericFactory in either Struts 1.3 or Struts 2.1.8.1. What is the fully qualified class name?
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
Nikhil Bansal
Ranch Hand
Joined: Jan 24, 2005
Posts: 60
|
|
Hi Joe,
I might be wrong in posting this query to this forum.
However, looking at this piece of code
ReferBackStatusBaseUI st = (ReferBackStatusBaseUI)GenericFactory.getInstance("referBackStatus");
where should I look for "referBackStatus". What does this parameter mean wrt GenericFactory ?
Also, since the object reference st gets the labels of buttons using st, where should I look for these labels....in some properties file or some xmls.
Nikhil
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8260
|
|
This has nothing to do with Struts. I think you are looking at a custom class that was written specifically for your application. The fully-qualified class name would help us determine that. You could also look at the Factory Pattern to understand what's going on.
I'll move this to the Java in General forum.
|
 |
Nikhil Bansal
Ranch Hand
Joined: Jan 24, 2005
Posts: 60
|
|
Any inputs, anyone.
Nikhil
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3028
|
|
Unfortunately there isn't much more to say. Since the GenericFactory is not a standard class, nor is it part of the Struts API, then it probably is something custom written. As such, the String could come from anywhere - maybe an XML file, maybe a different type of configuration file, maybe it is the name of a class or method that is looked up using reflection. Or maybe it is hard coded in the class.
Since you have access to the class, look up its documentation to find out how to get the String.
|
Steve
|
 |
Nikhil Bansal
Ranch Hand
Joined: Jan 24, 2005
Posts: 60
|
|
Hi Steve,
I digged in the application and found the following.
This is stored in factory-config.xml
<factoryClass name = "referBackStatus"
singleton = "false"
className = "com.ezy.psa.isacore.uiclass.b2b.referBack.ReferBackStatusUI" />
Now the issue is that referBackStatus is being used to display a few buttons.
<% ResultData navBut = new ResultData( st.navButtons );%>
Can you please let me know where can I find st.navButtons ? I mean where these button labels might be stored ? Again some xml, or some properties file
Thanks,
Nikhil
|
 |
Nikhil Bansal
Ranch Hand
Joined: Jan 24, 2005
Posts: 60
|
|
Can someone post a suggestion please.
Nikhil
|
 |
 |
|
|
subject: Query on GenericFactory
|
|
|