<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Expert;

import static Common.DatabaseConnect.DatabaseConnect;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author aaditya
 */
public class ExpertReport extends HttpServlet {

    
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try
        {
            HttpSession s=request.getSession(false);
            String loginname=(String)s.getAttribute("uname");
            String role=(String)s.getAttribute("rl");
            
            Integer expid=Integer.parseInt(request.getParameter("eno"));
            String temp=null;   //want to store expert name
            
            Connection con = DatabaseConnect();
            
            PreparedStatement pst2=con.prepareStatement("select * from experts where expert_id=?");
            pst2.setInt(1,expid);
            
            
            ResultSet rs2=pst2.executeQuery();
            if(rs2.next())
                temp=rs2.getString("username");
            
            if(temp!=null)
                loginname=temp;
            
            if(loginname==null)
            {
                request.setAttribute("msg","<i>You are not logged in. Please Login</i>");
                <commit_msg>try to fix expert report<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Expert;

import static Common.DatabaseConnect.DatabaseConnect;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author aaditya
 */
public class ExpertReport extends HttpServlet {

    
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try
        {
            HttpSession s=request.getSession(false);
            String loginname=(String)s.getAttribute("uname");
            String role=(String)s.getAttribute("rl");
            
	    Connection con = DatabaseConnect();

            if(loginname==null)
            {
                request.setAttribute("msg","<i>You are not logged in. Please Login</i>");
                
{'fraction_non_alphanumeric': 0.09753047827446076, 'fraction_numerical': 0.002813379180994061, 'mean_word_length': 2.7252619324796274, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '649184', 'n_tokens_mistral': 809, 'n_tokens_neox': 806, 'n_words': 186}