Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Rudy Gireyev

Ranch Hand
+ Follow
since May 03, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rudy Gireyev

Jeanne Boyarsky wrote:Rudy: I meant any Java code. I didn't have any specific code in mind.

Yup. I got that. I always read your posts very carefully as they tend to be quite insightful and always helpful. I just wanted to make the distinction between the different types of code that could go into a JSP. And while I agree that all other types of Java code should stay away from the JSP, I feel that the code that is presentation layer specific is perfectly at home within the JSP. Not only that, it is actually preferable to any other alternative that I have employed so far.

Bear Bibeault wrote:Arguments such as "it's easier" are invalid.

Invalid on what basis? Spaghetti code is more difficult to read and maintain than code that is clear and concise. Should we stop writing code that is clear and concise and start writing spaghetti code because it is more difficult?

Bear Bibeault wrote:It's much important to do thing correctly, than to do them easily.

Correctly, as defined by whom? Winds of fashion have blown over this profession for as long as I've been in it. And as such they don't always blow in the right direction. Please remember EJBs were once "The" technology to do things "correctly". I know you are old enough to remember.
8 years ago

Jeanne Boyarsky wrote: What do you think are the reasons people keep writing code in the JSP?

Hi Jeanne
Maybe it will help if you clarify what kind of code you had in mind. Like business logic, or persistence layer interface code or presentation layer code.

I personally prefer using JSP code for presentation layer because
1. It's standard JAVA, which means it's powerful, easily understood and flexible.
2. TLD libraries that use their own tags tend to be many in number, have limited functionality and sometimes contain bugs. On top of that they use auto generated code, something I try to avoid in general.

8 years ago

Greg Bag wrote:Hey guys I'm kind of confused on what to learn next. As in, what J2EE technology should I be learning next. My main purpose is for marketability and finding jobs.

I know Servlets, JSP, JDBC

First and foremost I'd like to congratulate you on having found a job as a programmer. No easy task in our field. Secondly I thought I'd throw SQL out there as an addition to your list above. My experience with Hibernate showed it be a solution looking for a problem, whereas SQL is simple, powerful, elegant and self documenting. It is also faster than using Hibernate. Having said all that I do see many job reqs list Hibernate in the requirements. Disclaimer: All of my programming is done in the business sector.

Stepping down a tier of importance and remaining in the business programming environment I find SOA to be very useful at least in my work.

However, I noticed that you are looking for work more on the defense contractor side of the business. This will call for more technical knowledge.

I wish you lots of success and to stay as energetic and hungry for knowledge as you are now.
9 years ago
Hi Somesh.

I don't know if this will be of any help or not, but if you use the request.setAttribute(timestamp) in your JSP, then it might work, if I understood your problem. When the user opens a new tab/window it will then be a new request and hence your servlet will get a new timestamp. Since request attributes are one shot deals.

9 years ago

Sandesh Shashidhar wrote:
I have a PDF file in my Webcontent/dir/helpdir.pdf and in JSP page i am trying to download the PDF by calling a servlet
The PDF is located in Webcontent/dir folder

Hello Sandesh. In your desription you state that the file is in the /dir directory .....

Sandesh Shashidhar wrote:String filePath =request.getContextPath()+"//doc//";

But in your code you are opening the /doc directory
9 years ago

Bear Bibeault wrote:
If you only care whether the record exists or not, why fetch all the data with a "select *"? To check for existence a "select count(*)" will be more efficient.

Hi Bear. I'm wondering if select count(*) would really be more efficient than say select username. I'm thinking that for select count(*) it has to read every row in the table no matter what, whereas for select username it will stop searching when the row is found.

Aryeh Golob wrote:
From this point, I would use a static class, say DbUtil to perform all interactions with the database.

Aryeh just to clarify, the DbUtil class need not be a Servlet, in fact should not be a Servlet, as it will not be interacting with the HTTP client, it will only be interacting with your servlets.

Stefan Evans wrote:But your mention of servlet context attributes and static classes sound sub-optimal.

Stefan why do you feel that using the static methods in the DB Access class is sub-optimal?

9 years ago
Hi Rex.

The option I had in mind was "-or" for Override Existing Code.

Generally speaking when I run Wsdl2java myself I usually do it from a command line. If you don't want to keep typing the command line parameters over and over you can simply create a batch file and invoke it.

Another suggestion I would make is to invoke the wsdl2java with the -h parameter only, or no parameter should work as well, so that you can see which parameters your version of wsdl2java accepts. That way you can check if that "src" parameter is correct.

Lastly, I wanted to mention that I now use Eclipse to generate the client code and no longer run wsdl2java manually.

9 years ago

Nico Van Belle wrote:
I know how to do this technically (with an interface) but I was wondering .. isn't there a Design Pattern for this?

thank you!

I'm curious to ask, if I may, why do you feel that you need a design pattern for something like this? Realistically speaking does it offer something to you that your own solution does not?

Try ../resources/..(foldername) and see if that works
9 years ago
There are several ways of accomplishing preselection of a row in STRUTS. It looks like the option you have chosen is to loop through your Collection yourself and build your select box manually. In this case you have to place the conditional statement, which I believe is another logic tag, that tests whether the value you'd like to preselect has been reached in the loop, and if so you'll have to output the option line with the selected attribute set.

Other options are using the the html:options or html:optionsCollection STRUTS tags and using their api to preselect the value for you.
9 years ago
Sorry, I don't understand what you are trying to do, and I also don't understand what is not working. Can you post a more detailed question?
9 years ago