Win a copy of Spark in Action this week in the Open Source Projects forum!

John Robert

Ranch Hand
+ Follow
since Jun 17, 2008
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 John Robert

Hello all,
I am asked to create a uml component diagram for an application. I have basic understanding of UML but never created a component diagram before. I was assuming I could do it in visio, but seems like the standard version of VISIO does not have a UML capabilities(not sure about this, but I could not create a UML diagram)

I am looking for any tools that can help me create this for me. Any help would be appreciated. Is there any open source tool that I can use to accomplish my task

Any response would be appreciated.
Thanks for the responses. Those did help me understand what I am looking for better. I just realized I never responded back. Thanks and sorry about that.
Hello,
I have a couple of questions

1.My xslt uses namespace because the input xml(the xml being transformed) uses a name space. In my transformed xml I see the name spaces I used in the xslt, even thought I do not have any elements from the name space in my transformed xml. Is there a way to ask the xslt to not include these name spaces?

2. Is it considered a xsd validation error, if the xml has additional name spaces , than what the xsd contains?

Thank you.
Ranchers,

I am looking to implement the following logging functionality in websphere 7. I am using log4j for logging, using a log4j.configuration file and all my logs are written to the SystemOut.log of that app server(Its a distributed app deployed on multiple app servers). Now I don't want to log to SystemOut.log but to a custom log file like Application.log. I am a little lost here because now I cant have one log4j.properties file(because if I use a rolling file appender in log4j.properties), the log folder of each app server varies.
For example for app server1 the log folder is
<WAS_ROOT>/logs/appserver1
and for app server2 the log folder is
<WAS_ROOT>/logs/appserver2

I am a little lost here. How do i configure each app server's logging?

Seems like this is a problem many people should have hit into but couldn't figure out a solution.

Any help would be appreciated.

Thanks,
10 years ago
Ranchers,

I am a little new to DBCP and trying to figure my way out. I was looking at the the following example code at DBCP Overview


In code, that might look like this:





I had trouble comprehending why the connectionFactory and poolableConnectionFactory (which uses the connectionFactory) initialized if its never used? Am I missing something here.
If all the datasource requires is connectionPool why cant we just create connectionPool and give it to the dataSource something like this


Am I missing something here?


And also is this implementation of the dataSource thread safe? can I have multiple threads call datasource.getConnection();


Any response would be appreciated

Thanks,



Ok thanks. I will look into jstl. I worked on struts 1.1 and am comfortable with struts tags. I belive I read somewhere struts tags can be used without the framework, may be I read it in the wrong context. I am trying to look for a taglib, that would help me maintain the state of elements on the JSP across requests.

Thanks
10 years ago
Ranchers,
I am writing an application, where I want to use the struts taglib only not the frame work. When I tried doing that I get an error struts tags without associated filter. I am using struts version 2.1.8

thanks
10 years ago
Ranchers,
I have a cluster in my server on which I deployed an application. I am just a little lost on how to configure a load balancer so that the request could be served by any of the Application servers in this cluster? Does websphere network deployment version come with some sort of load balancer or would this be outside websphere.I am a little lost here. I would Appreciate any help.
Thanks
10 years ago
Olk I will look into filters and use it. Thanks for the help.
10 years ago

Paul Clapham wrote:I don't understand the problem here. What do the CSS and javascript files have to do with authentication?

.
I am a little new to web apps,
may be I dint put the question right. I will try again. If I put a mapping in web.XML saying forward any request to my one servlet, what would happen when a request comes for JavaScript or Css file? My servlet dispatches the request to a jsp. The jsp has javasript and css files linked( the javasript is in a file outside the jsp).When the browser tries to retrive the JavaScript file , would it get back the JavaScript file or would it get forwarded to the servlet because I said in my web.XML forward any request to this servlet?
10 years ago
Ranchers,
I am writing a new web application in websphere 7. My webcontent has jsps, css and javasript files. I do not want to allow the user to directly access the content here like when they type
http://locahost:9081/TestApp i want to redirect the user to my servlet(bascially I want to redirect the user to my default servlet, other than if the request is for css or javascript). I am a little lost here. Basically the authentication is done in my servlet, so untill the control gets to my servlet, i have no way of knowing if the user is authenticated.

I would appreciate if anyone can throw some light on this,

Thanks.
10 years ago

Campbell Ritchie wrote:Disagree. Only make something "static" when you have a good reason to. Always try non-static first.



Ya you are right. What you said even is in line with

Ernest Friedman-Hill wrote:Hi John,

Not needing access to static data is one criterion for allowing a method to be static. I'd add three more requirements even given thids first criterion is met.


2) Methods that might need to be replaced or stubbed out during testing. If a class has a method called "queryDatabase()", during testing you might want to write a subclass that overrides queryDatabase() to just return some canned data. If the method is static, you can't do that. If you're new to programming, you might not appreciate this last point, but it's very important.

So actually, that leaves only a few kinds of methods that really should be static. The methods in java.lang.Math that return the square root, absolute value, etc, are great examples. They're all concentrated in one class, and you'd never want to change their behavior. The default should always be instance methods; static methods are a fairly rare exception.



I will follow that in my design. Thank you.
10 years ago
Thanks you all , the inputs gave me a great insight, especially the response by Ernest Friedman-Hill. I never thought in those lines before.

uj nossnahoj wrote:
A good rule of thumb is that you make the method non-static as a first approximation. You'll quickly discover whether this was the wrong choice because then you cannot use the method the way you intended. Then you change to static.



I actually was thinking the other way around, my theory was, first try to see if static woks for a method, if it does then do static, because from a efficiency/memory perspective you will not need to instantiate the class to call this method. May be I am wrong, I am not sure.

Once again thank you all.. Have a great weekend..
10 years ago

Leandro Coutinho wrote:static methods can't access instance variables



Thanks for the response, my question was, is that the criteria to determine if a method should be declared static or not.
10 years ago
Ranchers,
I know a static method is a part of a class as opposed to the object. But my dilemma is when i put a method as part of a class, when should i declare it as static, and when should i declare it non static. Here is my theory please correct me if i am wrong, if the method is accessing any of the instance variables(which effect the state of the object) , then declare method non static. Else declare static. Am I correct?

Any response would be appreciated..

Thanks,
10 years ago