Android – Checking Permissions in a Separate Class

I found some other topics that touched on this, but the solutions did not work for me. I have a class which contains the methods for checking permission, and I make a call to it in the I read from some people that I have to pass a Context and Activity to checkPermissions(), … Continue reading “Android – Checking Permissions in a Separate Class”

how to invalidate session in spring mvc for implementing logout

I have set the session attributes using @SessionAttribute annotation. @RequestMapping(value = “/login_action”) public ModelAndView login_action(@RequestParam(“email”) String email,@RequestParam(“password”) String password){ Query q=session.createSQLQuery(“SELECT User_ID,User_First_Name,User_Last_Name,Email,User_Type,Program,Level,Gender FROM Users WHERE Email=:email AND Password=:password”); q.setParameter(“email”,email); q.setParameter(“password”,password); Object u = (Object) q.uniqueResult(); model=new ModelAndView(“profile”); model.addObject(“user”,u); return model; } Now i need to invalidate this session while logging out. I tried like @RequestMapping(value … Continue reading “how to invalidate session in spring mvc for implementing logout”

how to send date through URL in ajax

Hi i have to append Date to a URL, maintaining its Datatype as Date and not as String When in append Date to URL as “?date=” + $(target).val(); i fetch it through @RequestParameter in my Controller But the problem here lies that i cant access it as Date but as String. If i access it … Continue reading “how to send date through URL in ajax”

How can I return ModelandView file and string?

Is it possible to get return object and string in js? Map<String, Object> myModel = new HashMap<String, Object>(); if (preview.equalsIgnoreCase(“pdf”)) { myModel.put(“IS_IGNORE_PAGINATION”, Boolean.FALSE); myModel.put(“format”, “pdf”); //return new ModelAndView(“returnOnReleasedConsignment”, myModel); }else if (preview.equalsIgnoreCase(“xls”)) { myModel.put(“IS_IGNORE_PAGINATION”, Boolean.TRUE); myModel.put(“format”, “xls”); myModel.put(“checking”, “true”); } return new ModelAndView(“returnOnReleased”, myModel);

MVC GUI Design – IOException in Model?

I am coding a GUI using the MVC (model, view, controller) design with JavaFX. The first thing my program does is read data from a text file, which in turn may or may not throw an IOException which I want to display as an error message dialogue in the GUI through the view class. Going … Continue reading “MVC GUI Design – IOException in Model?”

Pass parameters from a JFrame to another JFrame in NetBeans

I’m working on a assignment for university. The program use server/client(through sockets) along with a Model-View-Controller approach. I’m creating a login screen with a JFrame, this login screen must call another JFrame depending on who just logged in. As the title says, I’m trying to pass the controller from the Login JFrame to another JFrame. … Continue reading “Pass parameters from a JFrame to another JFrame in NetBeans”

spring MVC controller not redirecting to any views

I am new in spring and stackoverflow. I have a situation as follows: I clicked a button at index page which mapped to a controller class, I reached there but further mapping is not working as controller is not redirecting to desired view or jsp file further. Here is my controller class import java.util.List; import … Continue reading “spring MVC controller not redirecting to any views”

JavaFx MVC Getter throws NullPointerException

I’m trying to build a simple MVC app with JavaFx. It takes the value of the left TextField (tf1) and copies it into the right one (tf2) when you hit button b. So, when I define what to do when Button b is clicked, eclipse doesn’t show an error, but when I run the programme … Continue reading “JavaFx MVC Getter throws NullPointerException”

Get 404 http error with WEB-INF/views/index.jsp

I created simple Spring MVC project from an example but it doesn’t work. I use Tomcat and it doesn’t see my index.jsp in WEB-INF/views/ package and I get 404 error. But if I put index.jsp into webapp package, Tomcat will find it. That’s my configuration and classes: Project structure web.xml: <!DOCTYPE web-app PUBLIC “-//Sun Microsystems, … Continue reading “Get 404 http error with WEB-INF/views/index.jsp”