Hi,
Thanks.
I will check in later on.
regards,
Rafal
Dnia 8-02-2011 o godz. 6:20 bambang passion napisał(a):
hi,
pls. check on http error 303 or 304. it is occurred at client side and 304 means : not modified, it is just a message.
do check thoroughly the possible outputs for your getDateHeader,
i think the output will be an http message not DATE.
b.lÂ
2011/2/7 Rafał Laczek <rafal_lac...@wp.pl>
Hi,
The result of createRss.getTimestamp_long() is date in long format of last modification of my feed in RSS. This is the date when new message has been registered.
I try to display 303 error when there is no changes.
Please have a look for my present code. I know that there is here something wrong.
        System.out.println("Last modification is "+createRss.getTimestamp_long());
        response.setDateHeader("Last-Modified", createRss.getTimestamp_long());
     long lastModifiedRequest = request.getDateHeader("If-Modified-Since");   Â
     if(createRss.getTimestamp_long()>lastModifiedRequest){
           System.out.println("There is new message");
     }else{
           System.out.println("There is NO new message");
           response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); // 304
     }
Â
Dnia 7-02-2011 o godz. 15:27 bambang passion napisał(a):
hi,
sorry i dont understand what you want, may be you could elaborate more?
by the way, what is the result of createRss.getTimestamp_long() ?
also check what are the required attributes for response.setDateHeader() ?
b.l
2011/2/7 Rafał Laczek <rafal_lac...@wp.pl>
Hi,
Yes. Now it works. But I have the other small problem.
In my servlet I want to send date of last modification and when I refresh the browser to get back this date.
In response I try to send the date and in request to get this date.
Unfortunately in response I get -1
Â
Please look for following code:
response.setDateHeader("Last-Modified", createRss.getTimestamp_long());
 request.getDateHeader("Last-Modified");
  long lastModifiedRequest = request.getDateHeader("Last-Modified");
     System.out.println("Last modification has been done on " + lastModifiedRequest);
Â
Can you help.
Â
Regards,
Rafal
Â
Â
Dnia 7-02-2011 o godz. 3:58 bambang passion napisał(a):
HI,
you need to define the : ConnectionFactory and TOPIC
b.l2011/2/3 Rafał Laczek <rafal_lac...@wp.pl>Hi,Ă Â try{
Can somebody help me to get Message using following code.
Thanks
Rafal
Properties props = new Properties();
Ă Â props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
Ă Â "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
Ă Â props.setProperty(Context.PROVIDER_URL,"tcp://srv-waw-323:61222");Ă Â // create a new TopicConnection for pub/sub messaging
Context ctx = new InitialContext(props);
// lookup the connection factory
TopicConnectionFactory factory =
(TopicConnectionFactory)ctx.lookup("ConnectionFactory");
Ă Â TopicConnection conn = factory.createTopicConnection();
Ă Â // create a new TopicSession for the client
Ă Â TopicSession session =Ă Â System.out.println("TopicSubscriber is "+ subscriber.getTopic());
conn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
// lookup an existing topic
Topic mytopic = (Topic)ctx.lookup(TOPIC);
// create a new subscriber to receive messages
javax.jms.TopicSubscriber subscriber = session.createSubscriber(mytopic);
Ă Â } catch (Exception e) {
Ă Â Ă Â Ă Â e.printStackTrace();
Ă Â Ă Â Ă Â Ă Â Ă Â Ă Â Ă Â Ă Â }
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
Â
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=enÂ
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en