Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

cer

Greenhorn
+ Follow
since Sep 28, 2002
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 cer

yes
you can realize it with javascript or servlet :roll:
17 years ago
JSP
yes
i am a just a begginer of jsp and servlet,
after over one month learning,i find it is good for me to realize view with jsp,and servlet with the main logics.
at the same time,it is easy to maintaince the web app.
the Model II is so good.as we all know,every thing has two sides.
jsp or servlet ,it it only your decision. :roll:
17 years ago
hi,all
ijust want to write a ample to realize the function to open a new html page.the similar javascripts code is
<script language="javascript">
window.open("a.jsp","","")
</script>
now what puzzle me is that when i realize with java Servlet,it didn't work.
the code is:
[code]package org.w3c.jigsaw.filters;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import org.w3c.tools.resources.Attribute;
import org.w3c.tools.resources.AttributeHolder;
import org.w3c.tools.resources.AttributeRegistry;
import org.w3c.tools.resources.IntegerAttribute;
import org.w3c.tools.resources.ReplyInterface;
import org.w3c.tools.resources.RequestInterface;
import org.w3c.tools.resources.ResourceFilter;
import org.w3c.jigsaw.http.Request;

/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2000</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2000</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class Adv extends ResourceFilter{
private static final String CONTENT_TYPE = "text/html; charset=GBK";
//Initialize global variables
static {
Attribute a = null ;
Class cls = null ;
try {
cls = Class.forName("org.w3c.jigsaw.filters.Adv") ;
} catch (Exception ex) {
ex.printStackTrace() ;
System.exit(1) ;
}

}
public void init() throws ServletException {
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Adv</title></head>");
out.println("<body bgcolor=yellow>");
out.println("<font color=red size=10");
out.println("This is just an example for adv who route on me.<br>");
out.print("</font>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Adv</title></head>");
out.println("<body bgcolor=yellow>");
out.println("<font color=red size=10");
out.println("This is just an example for adv who route on me<br>");
out.println("</font>");
out.println("<p>The servlet has received a POST. This is the reply.</p>");
out.println("</body></html>");
}
//Clean up resources
public void destroy() {
}
}
[code]
who can help me out
with many thanks
17 years ago
hi ;
Now i am attending a JAVA course ,the main content is to explain the JigSaw web server.
Now i have many puzzles,if any one knows it ,pleaze tell me how to contact with u
many thanks to u
17 years ago
i think to get the ip address ,we can use :
HttpRequet.getClient().getInetAddress().getHostAddress()
to get the client ip address
then with the method System.getProperty(''os.name'') and System.getProperty(''os.arch''),we can get the informations of the client os.
17 years ago
the question has anoyed me so long,it is what the difference between c# and java,and which is more strongly in asp.net programming.
with many thanks
17 years ago
o ,yeah,
to me ,the question ia also interesting
17 years ago