Vikas Aggarwal

Ranch Hand
+ Follow
since Jun 22, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Vikas Aggarwal

I am suspecting that you problem lies here:

String comment = new String(cmntbox.getBytes("UTF-16LE"),"UTF-8");

try without it.
7 years ago
JSP
<%@ page language="java" %>
<%@ page import="com.mypackage.myclass" %>

<%
String testStr ="hello";

myclass mc1= new myclass();
myclass.myMethod(testStr );

%>


7 years ago
JSP
It is not possible to upload multiple files using only 1 <input type="file"> html tag. New web2.0 sites these days using ajax, or flash to acheive the same. There are a lot of open source flash based modules available. There few commercial ones as well.
7 years ago
If you are trying to do a Captcha sort of thing, there is a ready made provided by Google which you can plugin into your page. Try searching it on google labs or google code.
7 years ago
I agree with Bear Bibeault but if you really want to do it then call your class's method directly in JSP and pass as argument.
7 years ago
JSP
There is no direct way but using some javascript and ajax trick it is possible. If if you have several use cases like that you can build a jsp which will be called via ajax. In the url pass this javascript variable as parameter. Get this parameter from request in that new JSP and put it in session. But this trick may not be applicable to all use cases. The better way is to redesign the way you are currently building the page. Think different.
7 years ago
JSP
I googled and binged for a long time today to make it work. Finally it all paid off with some R&D. Here are the steps:

0. I was using jrockit 64 bit version. You can use any JVM.
1. Download 64 bit tomcat zip version from apache tomcat web site. I took the latest one.
2. Extracted tomcat in a directory
3. Installed jdk and set java_home and jre home properly.
4. Downloaded 64 bit tomcat6.exe etc from this path:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_16/res/procrun/
I downloaded amd64 ones and put them in procrun dir of bin dir. If there is no procrun dir then create one in bin.
5. Open service.bat of tomcat. It is there in tomcat\bin directory.
6. Go to line:
if exist "%CATALINA_HOME%\bin\tomcat6.exe" goto okHome

replace it with:

if exist "%CATALINA_HOME%\bin\procrun\amd64\tomcat6.exe" goto okHome

replace all such occurrences.

7. Go to line where it has jvm.dll as below:

set "PR_JVM=%JAVA_HOME%\jre\bin\jrockit\jvm.dll"

Make sure that the path to jvm.dll is correct. Double or triple check it. This is the most important thing.

Echo this path and test if required.

8. All set. Now run the command in bin directory of tomcat on a command prompt as below:

service install <your-service-name>

9. That's it.
8 years ago
Hi,

You can probably do that easily using log4j with tomcat. See below:

http://tomcat.apache.org/tomcat-5.5-doc/logging.html

This page has steps to control and configure tomcat log files.

By default tomcat does not use log4j but uses commons logging. You can change commons logging behaviour as well by changing catalina.properties files in conf dir.

Hope it helps.
[ April 02, 2008: Message edited by: Vikas Aggarwal ]
10 years ago
Hi,

I have a set up which has 2 tomcats. 1 of them are connected to IIS server. The second one does the house keeping job. Is there any way of monitoring the main tomcat server from an application deployed on house keeper tomcat? Both run on same windows machine.

I read about JMX etc. but is there a simple or open source way of monitoring tomcat from other tomcat?

Basically what I want is to get an email notification from House Keeper when the mainj tomcat goes down or is out of memory.


Thanks.
[ April 01, 2008: Message edited by: Vikas Aggarwal ]
10 years ago
Hi Friends,

I am looking for Best Swing Framework For Fast Development, which has few ready made components as well.

Also is netbeans the best editor today to develop a swing based dynamic application?

Thanks

Vikas
10 years ago
Thanks.

One more thing. It is unfortunate that I do not have much time to learn swing properly and then develop the application. So are there any ready made modules and tools available which I can plug and use to expedite the development process. The project requirement does not worry about look and feel. It is all about functionality.

Thanks.

Vikas
10 years ago
Hi All,

I have been working on java web based and middle layer solutions for a long time. But now I want to develop a desktop application in java.

Please help me. I need to know:

1. Where should I start from? Is there is any quick tutorial?
2. Which IDE is best for creating drag and drop java based application.
3. Are there any good tutorials on the best practices.

Thanks a lot.

Regards,

Vikas Aggarwal
10 years ago
Hi,

I have a jsp and a servlet. The servlet has been included in JSP. The servlet uses gzip stream to read file and send to browser. The problem is that when this JSP is called it throws witer already called exception. I understand this is because JSP has already a writer "out" which has been called and my servlet also has one.

Is there a way to get around this problem. I can not convert servlet to jsp because of security.

Thanks in advance.
10 years ago
Thanks for the replies.

I have implementted a front controller. Thsi sis what I have done:

1. Created a front controller which gets invoked when a URL with /ted/ is entered.

2. It finds the servlet that it needs send request to.

3. It forwards the request to that servlet.

Other points to note are:

1. Invoker servlet is disabled.

2. The servlets are mapped in web.xml (I tried using just 1 servlet named testservlet for this experiment and hard coded that servlet name in front controller).

3. The displatcher path in controller is "/testservlet".


But this does not work. It gives 404.

Can you please help me out.

Regards,
Vikas
11 years ago
Hi,

The problem with my application is that it has too many servlets because of its architecture and according to http://jakarta.apache.org/tomcat/faq/misc.html#evil we should not use invoker servlet for security reasons. The alternative to invoker servlet is to configure each and every servlet explicitly in web.xml. But configuring approx 280 servlets is not easy and I don't know what impact it would have on the tomcat startup.

Is there any other way e.g. URL rewriting etc?

Thanks.

Regards,

Vikas
11 years ago