Posts

Showing posts with the label spring-mvc

How to prevent the user from leaving my page [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP How to prevent the user from leaving my page [duplicate] This question already has an answer here: I'm trying to make an online test using spring-mvc and html, css, jquery and I want to prevent the user that is doing the test from leave the test screen while doing the test. Does anybody know how I can do that? This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. since it's from a web browser, no you cant. the user can make new tabs. close the browser and do many other things. – IbraHim M. Nada 10 mins ago disable the user to leave my screen please elaborate it. Do you mean by closing browser window OR just switch the window OR minimize the window? – VicJordan ...

Criteria API query fails

Image
Clash Royale CLAN TAG #URR8PPP Criteria API query fails I'm new at Criteria and can not understand the next thing. I've got entities with сonnection between each others User: //...fields... @OneToOne(fetch = FetchType.LAZY, mappedBy = "user") private Document document; Document: //...fields... @OneToOne(fetch = FetchType.LAZY) @PrimaryKeyJoinColumn private User user; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "doc_type_id", nullable = false) private DocType docType; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "citizenship_id", nullable = false) private Country country; DocType: //...fields... @Column(nullable = false, length = 5) private String code; Country: //...fields... @Column(nullable = false, length = 5) private String code; I need to find user with a document that contains the docCode (DocType.code) and citizenshipCode (Country.code). Dao: //private final EntityManager em; public List<User> filterUser(U...

differentiating multiple submit button using PropertiesMethodNameResolver

Image
Clash Royale CLAN TAG #URR8PPP differentiating multiple submit button using PropertiesMethodNameResolver I have a form with different submit buttons in Spring MVC application which is in xml . I differentiated using ParameterMethodNameResolver like <bean id="mnr" class="pkg.ParameterMethodNameResolver"> <property name="paramName" value="opt"/> </bean> But the problem here is, Method names are tightly bounded to button captions. So any modification in UI will affect java application. So I just want to use PropertiesMethodNameResolver .I used like <bean id="mnr" class="pkg.PropertiesMethodNameResolver"> <property name="mappings"> <props> <prop key="user.htm?opt=save">register</prop> <prop key="user.htm?opt=delete">remove</prop> </props> </property> </bean> But it ...