Surajsingh Thakur

Ranch Hand
+ Follow
since Sep 09, 2008
Surajsingh likes ...
Eclipse IDE MySQL Database Tomcat Server
Pune,India
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Surajsingh Thakur

In J2EE, use of the MVC model is highly encouraged
7 years ago
Can anyone please suggest a Good online link for JUnit tutorial.

Thank you
7 years ago
can I use a single java.util.logging.logger instance for entire project
Actually we can use this logger like this:
LOGGER = Logger.getLogger(SencitivitySpecificityBase.class.getName());
but this logger is for a specific class.
I want to use a single logger for the entire class.
static {

LOGGER = Logger.getLogger(SencitivitySpecificityBase.class.getName());
FileHandler fh;
try {

// This block configure the logger with handler and formatter
fh = new FileHandler("CCVDev.log", true);
LOGGER.addHandler(fh);
LOGGER.setLevel(Level.ALL);
SimpleFormatter formatter = new SimpleFormatter();
fh.setFormatter(formatter);

// the following statement is used to log any messages
//LOGGER.log(Level.WARNING,"My first log");

} catch (SecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
7 years ago
Hi All,
I want to color byte array of image pixels with any color say Color(25,25,50) preserving intensity of the original color.
Formula to calculate intensity of color: 0.3*R + 0.59*G + 0.11*B

Suppose current color of a image pixel is Color(50,25,23).
i.e.
current color - Red part - 50, Green part - 25 & blue part - 23.
apply color - Red part - 25, Green part - 25 & blue part - 50.

if I use bitwise AND opration I will get
Red part - 25, Green part - 25 & blue part - 23. ie. Color(25,25,23). thus intensity changes.
As you can see apply color has blue part prominant that means the end result should be some shade of blue with same intensity as the current color.
Can anybody give me exact formula or logic for this.
7 years ago
Hello Everybody.

I am designing a Web Application in Eclipse IDE.I have a servlet called Incoming Servlet which is as follows :-
package dynamics;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class IncomingServlet
*/
public class IncomingServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public IncomingServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
PrintWriter out = response.getWriter();


request.getRequestDispatcher("/WEB-INF/jsps/First.jsp").forward(request, response);


}

}



In this I am trying to call a jsp called First.jsp which is kept in /WEB-INF/jsps/ directory..
But when I am running the code,I am getting this Exception.

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
dynamics.IncomingServlet.doPost(IncomingServlet.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
dynamics.FirstFilter.doFilter(FirstFilter.java:47)


root cause

java.lang.NoClassDefFoundError: javax/el/ELResolver
java.lang.ClassLoader.findBootstrapClass(Native Method)
java.lang.ClassLoader.findBootstrapClass0(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:200)
org.apache.jsp.WEB_002dINF.jsps.First_jsp._jspInit(First_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
dynamics.IncomingServlet.doPost(IncomingServlet.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
dynamics.FirstFilter.doFilter(FirstFilter.java:47)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.18



So Kindly Help


Thank you.
Great Success... Congrats...
8 years ago
Hearty Congratulations and Welcome to Java Ranch..
8 years ago
Even i think its Refreshing the page in the client-Browser
8 years ago
Congratulations...
8 years ago
Congratulations....

8 years ago