File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query on GenericFactory

 
Nikhil Bansal
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no class named GenericFactory in either Struts 1.3 or Struts 2.1.8.1. What is the fully qualified class name?
 
Nikhil Bansal
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any inputs, anyone.

Nikhil
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nikhil Bansal
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone post a suggestion please.

Nikhil
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic