Win a copy of Event Streams in Action this week in the Java in General forum!

seshu Palamanti

Ranch Hand
+ Follow
since Jul 03, 2004
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by seshu Palamanti

Hi Every one,
I have a simple java web application that i deploy to tomcat, the war file is generated by maven build and has release information in it. The default context root of the is localhost:8090/warfilename...as the warfile name changes every time, i need a better way of having constant context root for the application i know having this in pom.xml

<build>
   <finalName>loginapp</finalName>
 </build>

will have  the final war file name constant but i want to know if this can be achieved by not having release information in war file names. Any help will appreciated.

Thanks
2 years ago
Thanks for your reply Ron,
I have access to Spring with out getting to deep into Spring I know this class ThreadPoolTaskExecutor can do the same and assuming if object can do the job a semphore and I have this object in servlet
My question is can i get hold of every thread that is getting into servlet by calling as Thread.currentThread gets current thread & if I execute it via ThreadPoolTaskExecutor it should restrict the number of threads executing. Will the code snippet capture all threads that run by?. Thanks again for your reply.
3 years ago
Assume that there is server side servlet which processes in coming requests from the web and the servlet container(Tomcat) would create or pull a thread from the pool and pass that thread to the servlet. How can I pool those threads coming in so as to allow only one or certain number of those in coming requests in other words those threads access to another resource lets a dao object? Thanks in advance for your help
3 years ago
Hi Every one,
I have a web application which requests a jasper export of the UI content (Single page app) with the click of an I icon on the web page the requests gets to a REST end point that takes the request and calls a spring processor class with a request object. The Processor class is a spring singleton scoped bean which calls an extended class’s report fill method which actually makes the db call to fill the jasper report after which the response is routed and the browser gets back the exported file. As the number of requests goes up I was thinking of implementing some sort of thread pool to hold incoming requests from the web in this processor and allow only limited set of threads to execute at any time as the number of records for each export can be quite big, after looking around I hit up on org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor. I am injecting taskexecutor into the processor class. My question is how do I get access to incoming thread requests and how to use taskexecutor. I am assuming will pull in coming threads and putting them in taskExecutor will make restrictions to start to kick in using settings. I am right? Please correct me if I am wrong Thanks in advance.



3 years ago
Hi Every one,
I read in various books, forums and believed that irrespective of string manipulation on literals string == operator will always return true, here is a very simple program and its output i want to to know why string1==string4 returns false ? even though both are string literals. Does it mean a string concatenation on string literals will return a new object ?

Runs Output:
string1= helloWorld
string2= helloWorld
string3= hell
string4= helloWorld
string1==string2 is true
string1==string4 is false

Thanks.
4 years ago
Samrat,
Here are the steps that I followed

1) run wsimport http://wsdl file location
2) Copy the generated .java files into your project source.
3) Write your own class to connect to Lists and print it out on console.
4) Set username and password to connect to webservice.

Here is the complete code. Hope this helps
5 years ago
Samrat,
Can you please tell which problems you are getting into while doing call on Lists
5 years ago
Hi Ranch,
I am trying to use MS Sharepoint via Web Services using Java code, I have successfuly been able to use Lists WSDL to generate code using WSIMPORT and connect to sharepoint using basic authenication, call get lists method which returns the list of file objects on the document library in XML. Now I am trying to do file check in (File upload) and check out ( File download) using the same approach, I would really appreciate any suggestion or help in this Endeavour. Thanks in advance.

5 years ago
I sincerely welcome the authors and hope they have great success with there book.
6 years ago
A Arduino book from Manning sounds great, a quick question to the authors here...does knowing Java help in programming Arduino better in any way?.
6 years ago
Thanks for all your help..by creating another css and overriding the classes as desired i was able to achieve what i was looking for. I added that link in the webpage and when window.print() was called this print css would be used and this would happen with out any further code.

<LINK href="${pageContext.request.contextPath}/css/print.css" media="print" rel="stylesheet" type="text/css">

regards
Paul,
Thanks again.....sorry if dynamic might have mis represented what I was trying to look for.. i get your idea here...of having two types of css one each for display and print.
Paul,
Thanks again for your super quick reply....is there a way to put on scrollbars to an open window which was opened with 'scrollbars=no'?

var win = window.open(url, name,
'width=' + width + ', height=' + height + ', ' +
'left=' + left + ', top=' + top + ', ' +
'location=no, menubar=no, ' +
'status=yes, toolbar=no, scrollbars=no, resizable=yes');
Thanks for your fast reply Paul, i really appreciate it....as you mentioned that window.print() will only print what ever is there on the window at that movement is there a way we could dynamically change the window scroll bars and also css content before we call print() so that content prints out? Again any help will be appreciated.
Hi Every one,
I have a open window which contains the data from a jsp that needs to be printed. There are 2 things about the window
1) It has been opened using a javascript like this

var win = window.open(url, name,
'width=' + width + ', height=' + height + ', ' +
'left=' + left + ', top=' + top + ', ' +
'location=no, menubar=no, ' +
'status=yes, toolbar=no, scrollbars=no, resizable=yes');
2) The content which is a huge list of data is available on the page with internal scroll bars using a css like this
div#scrollableContent {
height:380px;
overflow-x:hidden;
overflow-y:scroll;
}
<div id="scrollableContent">

As mentioned earlier the aim of this exercise is to print the window containing whole content currently when i just use
window.print(); it only prints the first few lines with internal scroll bars for the div. I changed "scrollbars=yes" in the open window
function and also changed overflow-y:hidden; in css which gets the desired print but i wanted to get any help to do this using javascript
dynamically as this should only be for printing the window and not for display.

Any help or direction is really appreciated.

Regards