ht kim

Greenhorn
+ Follow
since Aug 02, 2001
Merit badge: grant badges
For More
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 ht kim

yes you are right.
i just checked the java file interpreted from the jsp out. and there was setContentType method calling like this.
response.setContentType("text/html;charset=ISO-8859-1");
so setContentType before jsp executing was overwritten.
thanks napa.
22 years ago
hi,
i'm using jakarta-tomcat-4.0.1.
i made servlet code that looks like below,
response.setContentType("text/vnd.wap.wml");
RequestDispatcher rd = getServletContext().getRequestDispatcher("/wml1.jsp");
rd.forward(request, response);
and i requested to that servlet,
browser gets content type "text/html" instead of "text/vnd.wap.wml".
how did i get this unexpected result?
does forward method changed response object's content type?
if then, how can i set the content type correctly
without specifying the content type to jsp file(/wml1.jsp).
22 years ago
thanks so much, joe.
i'll try Filters.
and i guess it maybe helpful to me.
:]
22 years ago
hello.
what i want to do is something like RequestDispatcher.forward method.
but i want to change the forward url's result stream before client browser gets it.
and then the modified result stream would be sent to client browser.
can i set the outputstream of response to memory instead of client socket?
i tried to find that kind of method, but there wasn't.
of course, i think i can make a method that gets the forward url's result stream.
but the problem is that calling that method is another http request,
so i cannot pass the request instance.
therefore informations in request instance should be lost.
is there any good way to solve this problem?
thanks
22 years ago
you wrote <url-pattern>*</url-pattern>
then all requsts are gonna send to FC servlet
include your *.jsp forwarding request.
one possible way to solve this problem is,
change the url-pattern in web.xml(ex. *.go).
then *.go url will be requested to FC,
and inside FC, forwarding to *.jsp will work okay.
22 years ago
very thanks for all of your help..
i wanna implement simple chat client for my study with J2ME.
so what i need is socket event listener.
i wanna patch the read event regardless of user action.
and whenever socket event has occured, the screen should be updated by the event.
so i can not use button event based reading.
so i think that should be some thread-based way as you said..
i also implement the socket event listening thread.
but socket event checking whether event has occured or not should be something like loop again, right? if then, the same problem will be occured.
or you mean that the new thread handles screen as well as socket event..? then is the thread new MIDlet?
thanks..
22 years ago
hi guys.
i'm new to j2me .
do you have any idea what causes the problem with below code?
it's just example code in toolkit and i put in simple loop code there.
i thought that setCurrent adds SCREEN event and then that event is processed immediately (by other rendering thread?) if possible.
but program does not draw the screen when while statements are in there.
if I remove while statements, it works well and shows the "Test string" screen.
does it mean that draw is starting after executing startApp?
if then, how can I implement my event patching(something socket read) loop, and where is right place to put the loop?
of course, i can make event reading code with thread, but i guess event polling must be loop..
and what is excuting after startApp ends? i mean executing flow..just only event listener thread waits for event?
thanks in advance..and below is the code.
thank you =)

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloMIDlet extends MIDlet implements CommandListener
{
private Command exitCommand;
private Display display;
public HelloMIDlet()
{
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 2);
}
public void startApp()
{
TextBox t = new TextBox("Hello MIDlet", "Test string", 256, 0);
t.addCommand(exitCommand);
t.setCommandListener(this);
display.setCurrent(t);
while (true)// what i added.
{
// i wanna check some conditions(ex. socket reading), and then process it repeatedly.
System.out.println(".");
}
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c, Displayable s)
{
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
22 years ago