This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!

Amit Chandigarihan

Greenhorn
+ Follow
since Mar 05, 2009
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 Amit Chandigarihan

Hi,

We are using Swing UI for our project.
Sometimes we observe a peculiar behavior in our application.
Sometimes if we type any characters in any textbox, it comes in reverse order.
eg, if we type abc, it types a , then b before a and c before ba.
So finally, it ends up in wrong inputs in the screen. It generally happens when the screen is left idle for a long time.
below is a method used in our code.


This method is in an innerclass which is extending PlainDocument.java class.

Can you please let me know if anyone had come across this problem before and possible solutions?

Thanks in advance
11 years ago

Steve Fahlbusch wrote:If you want it to be like ping - why not just ping?



But how can we implement ping request in java?
12 years ago
We have a client and a server.I want to measure responsetime of network between them.When i send request to server it should immediate response my request,it should be like ping request so that there will be no processing time at server.
How can i do this in JAVA? Kindly help me to resolve this issue.
12 years ago
<%--This will give my name as I am logged in user of my machine --%>

<% String name;
name = System.getProperty("user.name");
%>User Name of local machine is : <%=name %>
<br>
<%
String rName= request.getRemoteAddr();
java.net.InetAddress localMachine=java.net.InetAddress.getByName(rName);
String username= localMachine.getHostName();
%>Your IP address is: <%=username %>
<br>
The point where I am getting Null:
<%
String str=request.getRemoteUser();
%>


<input type="text" value="<%=str %>">
</body>
</html>


Why request.getRemoteUser( ) gives null. I am on company's network domain. So I want anyone who tries to access my page should get welcome message like Welcome Username of that person on company network.

Is there any other way of doing the same thing?
12 years ago
JSP
I have two jsp pages P1 and P2 . When P1 is invoked it picks the details from the database and displays on the page. The details are displayed in the form of a table with each row having a radio button.
When any radio button is checked and then particular link is pressed say "Preview and Announce Party" then the particular id connected with that radio button is taken and it has to be passed to struts-config form-bean so that i can capture it in another Action class.

My question is can i pass the value of the variable through a javascript function to struts-config.xml . How?

My code is like this

<script type="text/javascript">
function announce()
{
for(i=0;i<document.forms[0].seminarID.length;i++)
{
if(document.forms[0].seminarID[i].checked)
{
val=document.forms[0].seminarID[i].value;
}
document.forms[0].action="/Announce";
document.forms[0].submit();

}
</script>

and this function is called from the code

<html:link href="/Announce.do" onclick="javascript:announce()">Announce Party</html:link>


I am new to Struts framework .
12 years ago
JSP