Jump to content

Recommended Posts

Posted

[quote name='innovative' timestamp='1373223429' post='1303928417']
padeyyatam endhuku ... :(

india lo vunnaya ..
[/quote]ma intlo evvaru software field kadu..... eppati nuncho icheddam ante evvaru tesukotledu.... inka vallu matram em chestaru...... IIT books kuda vunnayi kavalante....

ya India lo vunnayi....

Posted

[quote name='bantrothu bullabbai' timestamp='1373223589' post='1303928423']
ma intlo evvaru software field kadu..... eppati nuncho icheddam ante evvaru tesukotledu.... inka vallu matram em chestaru...... IIT books kuda vunnayi kavalante....

ya India lo vunnayi....
[/quote]

hmm ... india lo ante inka public library vallu emanna theskuntaremo kanukomanu .. jus an idea ya .. coz those r good books on java kada andhuke trying to save them .. sSc_hidingsofa[size=4] [/size]

Posted

[quote name='innovative' timestamp='1373223745' post='1303928431']
hmm ... india lo ante inka public library vallu emanna theskuntaremo kanukomanu .. jus an idea ya .. coz those r good books on java kada andhuke trying to save them .. sSc_hidingsofa
[/quote]mari antha irresponsible kadule.... ma illu antha books kuppa... nene em chadavaledu.... dusting appudu parents ki problem avutundi.... libraries gurinchi alochinchi call chesi chala sarlu intimate chesam.... venaka kuda paddam.... pattinchukotle.... me books evariki kavali ane attitude vuntundi valla side nundi..... I don't expect my dad to lift those heavy weights pack them and put them on his vehicle and take them and give it to them.... nuvvu velli teesukuni kavalsina vallaki ichey.... leka pothe nenu India vellentha varaku aagali S%Hi

Posted

[quote name='bantrothu bullabbai' timestamp='1373224191' post='1303928445']
mari antha irresponsible kadule.... ma illu antha books kuppa... nene em chadavaledu.... dusting appudu parents ki problem avutundi.... libraries gurinchi alochinchi call chesi chala sarlu intimate chesam.... venaka kuda paddam.... pattinchukotle.... me books evariki kavali ane attitude vuntundi valla side nundi..... I don't expect my dad to lift those heavy weights pack them and put them on his vehicle and take them and give it to them.... nuvvu velli teesukuni kavalsina vallaki ichey.... leka pothe [b]nenu India vellentha varaku aagali[/b] S%Hi
[/quote]

okay ... :)
Bold : may be thatz the best thing to do ..

Posted

[quote name='innovative' timestamp='1373224307' post='1303928449']

okay ... :)
Bold : may be thatz the best thing to do ..
[/quote]yugalu yugalu gadichi poyi kotta technologies vastayi emo... :P

Posted

ltt

Posted

public ModelAndView saveUser(Register register,BindingResult bindingResult)

BindindResult ante ento cheputaara jailar gaaru

and manam modelandview object enduku use chestam

Posted

[quote name='remo_401' timestamp='1373588568' post='1303943197']
package com.music.controller;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.music.model.Register;
import com.music.service.RegisterService;






@Controller
@RequestMapping("/main")
public class RegisterController
{

//

@Autowired
RegisterService registerService;

@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView login(Register register,HttpSession session)
{
System.out.println("hello");
String user=(String)session.getAttribute("user");
String role=(String) session.getAttribute("role");
if(role!=null)
{
if(role.equalsIgnoreCase("admin"))
{
return new ModelAndView("admin", "command", new Register());
}
else
{
return new ModelAndView("redirect:/index.jsp");
}
}
return new ModelAndView("login", "command",[u][b][i][size=6]register);// ikada new Register() anni enduku petatle[/size][/i][/b][/u]
}
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ModelAndView login1(HttpSession session)
{
session.removeAttribute("user");
session.removeAttribute("role");
session.removeAttribute("total");
session.removeAttribute("cat");
session.removeAttribute("title");

return new ModelAndView("login", "command", new Register());
}



@RequestMapping(value = "/register", method = RequestMethod.GET)
public ModelAndView register()
{
return new ModelAndView("register", "command", new Register());
}

//Add New User
@RequestMapping(value="/addUser",method=RequestMethod.POST)
public ModelAndView saveUser(Register register,BindingResult bindingResult)
{
java.util.Date d=new java.util.Date();

String dd=d+"";
String dd1=dd.substring(4,10);
String dd2=dd.substring(24,28);

dd2=dd1+","+dd2;

register.setUserf(dd2);
register.setUsert("user");
registerService.addUser(register);
return new ModelAndView("login", "command",new Register());
}


//Check Login Detail
@RequestMapping(value="/loginUser",method=RequestMethod.POST)
public ModelAndView checkUser(Register register,BindingResult bindingResult,HttpSession session)
{
String username=register.getUsername();
String password=register.getPwd();

List<Register> users=registerService.checkUser(username, password);


if(users.size()>=1)
{
// for(Register reg:users)
// {
// String role=reg.getUsert();
// }
String rl="admin";
Register register1=users.get(0);

//Long id=register1.getId();
String role=register1.getUsert(); //Retrieve the role of user

//session.setAttribute("ID",id);

if(role.equals("admin"))
{
session.setAttribute("user",username);
session.setAttribute("role","admin");

return new ModelAndView("admin", "command", new Register());
}
else
{
session.setAttribute("user",username);
session.setAttribute("role","user");
Integer ab=(Integer)session.getAttribute("check");
if(ab!=null)
{session.removeAttribute("check");
return new ModelAndView("redirect:../check/order");
}
else
{
return new ModelAndView("redirect:/index.jsp");
}
}
//return new ModelAndView("admin");
}
// else
//{
// return new ModelAndView("redirect:/login");
//}

return new ModelAndView("redirect:/main/login");
}


//User List

//UserList
@RequestMapping(value = "/userList", method = RequestMethod.GET)
public ModelAndView userList()
{
List ab=registerService.viewUser();
return new ModelAndView("userlist", "ab",ab);
}



}
[/quote]

ikada manam "new" operator enduku use while returning.usage ento cheputaara evaraina

Posted

[quote name='remo_401' timestamp='1373588408' post='1303943189']
public ModelAndView saveUser(Register register,BindingResult bindingResult)

BindindResult ante ento cheputaara jailar gaaru

and manam modelandview object enduku use chestam
[/quote]


ModelAndView :

View -> jsp to display , path mention chestham
Model -> AppBean which uses as model in the jsp.

Earlier spring version return type string vundedhi (we can use that still) .. So model set chesi.. return lo "jsp path " mention chese valla.. But now.. we can return ModelAndView ..



BindingResult - is one of the input to the Spring validator , and validation appudu emaima errors vasthey it will be in binding result. This contains the messageCode to display , variableName for the filed to which validation fails. like that

Nenu just overlook cheppa..

Posted

[quote name='remo_401' timestamp='1373588715' post='1303943202']
ikada manam "new" operator enduku use while returning.usage ento cheputaara evaraina
[/quote]

between what information register holds , when this method is getting called.

in the mentioned..

if the role is admin they are create a new register object and going ahead further.

if role is other the than admin , they are redirecting to register jsp.

if role is null , they are passing the same register object .. until the functionality is not clear , its difficult to say.. as register object is defined based on ur project need.


Project looks like.. as its being developed by fresher.. is this a curicullam project

Posted

[quote name='innovative' timestamp='1373206046' post='1303927683']
progress bars with swings [url="http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html"]http://docs.oracle.c...s/progress.html[/url]
[/quote]
[img]https://lh6.googleusercontent.com/-WrUDCjcd4Uo/URHIk8KlA4I/AAAAAAAANGA/YmkKpZyLHZo/s150/MN-2.gif[/img]

Posted

inthaki idemi framework meeru discuss chesedi ModelView e framework?!!

Posted

java sucks

[img]http://chitrabhoomi.com/wp-content/uploads/2013/06/Ileana.jpg[/img]

Posted

[quote name='vickydada' timestamp='1373602749' post='1303943677']
inthaki idemi framework meeru discuss chesedi ModelView e framework?!!
[/quote]


Spring

×
×
  • Create New...