添加自定义注解
package org.book.configuration.aop; import java.lang.annotation.*; @Documented @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface NoCheckLogin { }
创建一个SpringMvcHandler 类,继承HandlerInterceptorAdapter
package org.book.configuration.Handler; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.book.common.JsonResult; import org.book.configuration.aop.NoCheckLogin; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; import java.lang.reflect.Method; @Slf4j public class SpringMvcHandler extends HandlerInterceptorAdapter { public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) throws Exception { } public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) throws Exception { } public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { HandlerMethod hm = null; Method method = null; if(handler instanceof HandlerMethod) { hm = (HandlerMethod) handler; method = hm.getMethod();// 获取方法 } else { return true; } // 该方法是否添加 允许未登录访问注解 if (method !=null && method.isAnnotationPresent(NoCheckLogin.class)) { // 不拦截 return true; } String name = (String) request.getSession().getAttribute("user"); if (name != null) { return true; } else { response.setCharacterEncoding("UTF-8"); response.setContentType("application/json; charset=utf-8"); PrintWriter out = null; try { out = response.getWriter(); out.append(new JSONObject().toJSONString(JsonResult.renderFail("用户未登录")) ); }catch (Exception e){ out = response.getWriter(); out.append(new JSONObject().toJSONString(JsonResult.renderError("后台出错"))); log.info(e.getStackTrace().toString()); } return false; } } }
被@NoLoginCheck注解的方法不会被拦截在springmvc配置文件配置拦截路径和排除路径
<mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**"/> <mvc:mapping path="/"/> <mvc:mapping path="/index.jsp"/> <mvc:exclude-mapping path="/assets/**"/> <mvc:exclude-mapping path="/images/**"/> <bean class="org.book.configuration.Handler.SpringMvcHandler"></bean> </mvc:interceptor> </mvc:interceptors>
1)预处理preHandle()方法
用户发送请求时,先执行preHandle()方法。会先按照顺序执行所有拦截器的preHandle方法,一直遇到return false为止,比如第二个preHandle方法是return false,则第三个以及以后所有拦截器都不会执行。若都是return true,则执行用户请求的url方法。
2)后处理postHandle()
方法调用了Service并返回ModelAndView,但未进行页面渲染,可以在这里继续修改ModelAndView
3)返回处理afterCompletion()
方法已经渲染了页面,在afterCompletion中,可以根据ex是否为null判断是否发生了异常,进行日志记录。注:一般使用preHandle这个拦截器进行预处理,对url进行请求拦截
Comments | 29,508 条评论
博客作者 canada pharmaceuticals
It’s amazing in favor of me to have a web site, which is valuable in favor of my know-how. thanks admin
博客作者 JaffarSedaeromo
If there’s a couple of brood of parasites creating within the blood at one time, then the fever can happen daily, obscuring the analysis. Regular assessments of blood stress, urine rigidity is present with systolic values of 160 mm Hg or protein, and fetal heart tones and activity are required. A histologic part from the mass reveals a tumor composed of small, primitive-showing cells with hyperchromatic nuclei and little to no cytoplasm medications during childbirth [url=https://delvv.com/order/Lamotrigine.html]purchase cheapest lamotrigine and lamotrigine[/url].
Thus, maltol might regulate pigment aggregation by way of a retinal-based concentration (1,one hundred particles/L) have been applied for ninety six hours exposure. Be familiar with nonendocrine manifestations of autoimmune polyendocrine syndrome, kind I four. If you are taking more Esmya than you need to Experience with Esmya when several doses are taken without delay is restricted spasms poster [url=https://delvv.com/order/Mefenamic.html]buy mefenamic 500 mg overnight delivery[/url]. Acetyl esters of carnitine Acetyl-L-carnitine and propionyl-L-carnitine are proposed to inhibit acetyl coenzyme-A and produce an antiproliferative impact on human endothelial cells. Questions 80 by way of 84: For each of the following statements, select whether or not it’s applicable to one of many following drugs. Presentation, analysis and scientific course of the spectrum of progressive-fbrosing interstitial lung diseases hiv infection rates thailand [url=https://delvv.com/order/Atacand.html]atacand 16mg buy online[/url].
博客作者 canadian pharmaceuticals
Hey are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you require any coding knowledge to make your own blog? Any help would be really appreciated!
博客作者 KelvinGaity
The weight of the neonate at the end of 1 week is simply the identical as it was at delivery, the paediatrician ought to now advise a. Assessment of salivary biomarkers and/or new imaging ity because of secondary occlusal trauma and the sequelae of tooth loss: technologies could enhance early detection of stage I periodontitis posterior bite collapse and drifting. The protein and fber content material of adult formulation are higher than a baby might require, so particular consideration is required to make sure a child receives enough fuid treatment quadriceps strain [url=https://delvv.com/order/Albenza.html]order albenza no prescription[/url].
The exact reason for the disease has not been established however appears to be complex. Generally ear protectors are more practical for the upper frequencies of this range. The proven fact that each of those bile pigments are lipophilic, particularly bilirubin, makes them typically more effective than water soluble antioxidants in stopping the harm of membranes and organelles medicine symbol [url=https://delvv.com/order/Thorazine.html]cheap thorazine 100 mg buy online[/url]. The elevated supply of sodium to the distal tubule, where it may be exchanged for potassium, will increase urinary potassium losses and will subsequently cause hypokalaemia. There are cross and tangential sections of all been isolated in animals with and with out diarrhea. In general, frozen section examination of the margins will usually be undertaken intraoperatively, and, importantly, when a line of resection has uncertain clearance because of indistinct tumor margins, or there’s suspected residual disease (ie, soft tissue, cartilage, carotid artery, mucosal irregularity) medications for ocd [url=https://delvv.com/order/Neurontin.html]600 mg neurontin purchase visa[/url].
博客作者 pharmacy online no prescription
Thanks for some other informative blog. Where else may I am getting that kind of information written in such an ideal manner? I’ve a undertaking that I am just now operating on, and I’ve been at the glance out for such info.
博客作者 pharmacy online no prescription
Thanks for some other magnificent article. The place else may just anybody get that kind of information in such an ideal way of writing? I’ve a presentation subsequent week, and I am at the look for such info.
博客作者 pharmacy online
Greetings! I know this is kinda off topic but I was wondering which blog platform are you using for this website? I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.
博客作者 buy heroin
kerimzi kurulta şurlampi cickcikcicik
博客作者 canadian pharmaceuticals online
I am regular reader, how are you everybody? This piece of writing posted at this web site is really good.
博客作者 Calvinsox
Яко необходимо элита у покупке постоялый двор для извлечения смс
Прогрессивные технологии отворяют чертова гибель перспектив для пользователей, а также получение условного постоялый двор чтобы SMS остановилось одной с самых потребованных услуг. Ниже выявлены все детали на аспектах при приобретению условных временных номеров для смс, и еще преходящих номеров чтобы Турции, в течение том части нюансы ихний получения у поддержке крипты.
Виртуальный номер телефона Турции: успехи и средства
Виртуальные номера телефона дозволяют пользователям принимать равным образом пускать спича, не быть хозяином физиологической SIM-карты. Эта эвентуальность максимальна удобна чтобы тех кто такой иметь намерение пройти какой-никакую так регистрацию равным образом у нынешнем остаться чисто неподписанным. Виртуальный штучка телефона Турции не только выявляет новейшие кругозоры для юзеров в этом районе, хотя равно дает ряд положительных сторон https://vanillafe.com/export-potential-of-coconut-products/#comment-20372
Как приобрести штучка чтобы регистрации
Купить временный штучка телефона может выискаться числа много сложноватым, хотя следуя ряду советов, шиздец хоть сделать самое большее просто также не экстремально.
Сверху этот момент большинство сервисов у доставанию условных номеров призывают крипто фигуру оплаты, яко дополняет домашней простосердечности в течение приложении.
Покупка условного постоялый двор за криптовалюту это ядреный шансище неподписанной работы
Все немалую популярность у труде немного временными условными номерами представлять из себя возможность приобрести фантомный штучка за криптовалюту. Это эпикризис имеет несколькими главными достоинствами:
В ТЕЧЕНИЕ завершении желательно б пометить минуты что так необходимо приобрести фантомный номер на Турции
Покупка виртуального номера для SMS, особенно в течение этих краях, как Туретчина, отворяет свежие кругозоры как для собственного, так да чтобы бизнеса. Возможность извлечения скоротечного номера чтобы регистрации и анонимного впуска к предложениям случит эту опцию экстренно живой в сегодняшнем цифровом мирке. А экспресс-оплата услуг немного содействием криптовалюты присовокупляет хоть больше свободы также фасилитиз в этот эпидпроцесс. Разглядывая все настоящие аспекты, хоть один-другой полной уверенностью утверждать, яко условные номера — этто через просто тренд, а ударность чтобы многих пользователей https://vykicicus.blogger.hu/2011/08/20/csok
博客作者 shoppers drug mart pharmacy
Hello! This post couldn’t be written any better! Reading this post reminds me of my good old room mate! He always kept chatting about this. I will forward this page to him. Fairly certain he will have a good read. Thank you for sharing!
博客作者 KafaDullies
A client may be пїЅ Adults: in remission for a protracted period of time and then they пїЅ Sensitivity = ninety five-100% present to you within the clinic with pain or some type of пїЅ Specifcity = 16% problem which may indicate that the most cancers has come пїЅ Children: again. Today’s children should haven’t solely established a result of their contact with the enamel in addition to fom fluoride medical properties but in addition established dental properties as a part of toothpastes, fuoride mouth rinses, and other extra concenпїЅ their complete health care program. All potentially contaminated caging and housing areas should be disinfected completely earlier than reuse to get rid of any infectious organisms anxiety 5 things [url=https://fnfgc.com/health/Emsam.html]discount emsam 5 mg on line[/url].
The diagnostic examine was accomplished with mammography, in which a picture of architectural distortion in the upper-outer quadrant of the proper breast could be observed. Rituximab – severe cytokine release syndrome is characterised by extreme dyspnoea, typically accompanied by bronchospasm and hypoxia, along with fever, chills, rigors, urticaria, and angioedema. It is by pure experiments and precise observations only that this object can be obtained spasms esophageal [url=https://fnfgc.com/health/Zanaflex.html]order zanaflex toronto[/url].
博客作者 VandornPeaws
All questionnaires have been coded prior to processing and analysis, guaranteeing blinding. The fuid quantity related to its administration could be an additional but secondary consideration. In industrial phrases, the automobile sellers are calling for fifty thousand pickup vehicles but the meeting line is just delivering ten thousand arteria occipital [url=https://delvv.com/order/Lopressor.html]12.5 mg lopressor purchase[/url].
See the Medicare Benefit Policy Manual, Chapter 1, Inpatient Hospital Services, 10, for extra instructions on hospitalization for renal dialysis. E x t e r n a l g l i o m a s a l s o r e q u i r e a n e l l i p t i c a l s k i n i n c i s i o n o r e x t e r n a l r h i n o plasty approach. The method to sufferers with persistent hypercalcitonemia with out manifestation of illness is still not clear, with the literature divided between a wait and watch coverage as against aggressive surgical utility treatment resistant depression [url=https://delvv.com/order/Hydrea.html]hydrea 500 mg order fast delivery[/url]. Such pains have normally been occurring for ended questions, go on to examine the nature of the weeks or extra and get progressively worse, and may signs in more detail. Protective response at low doses (hormesis) can be illustrated totally different from hormesis, but is similarly effective in opposition to toxic both as an increase in cell viability (left) or a decrease in tumor effects. Immature Rh antibodies throughout the affected person’s serum sug dendritic cells positioned within the dermis are gests that she has been uncovered to the blood of named Langerhans cells, and they’re highly a minimum of one Rh-constructive fetus gastritis atrophic symptoms [url=https://delvv.com/order/Diarex.html]30 caps diarex purchase with mastercard[/url]. Hemorrhage that leads to blood transfusion is the main cause of extreme maternal morbidity in the United States closely adopted by disseminated intravascular coagulation (2). What adjuvant (postsurgical) the selection of treatment is determined by the therapies improve the well being and menopausal standing of the survival fee in ladies with affected person, the estrogen and progesterone invasive breast most cancers. In the basic research of this phenomenon, Spencer and Fremouw (1979) divided participants into restrained eaters and unrestrained eaters primarily based on scores on a self-report measure of dietary restraint symptoms of flu [url=https://delvv.com/order/Quetiapine.html]100 mg quetiapine order free shipping[/url]. Journal of medical oncology : official journal of the American Society of Clinical Oncology (2004). Because most cancers cells in the body grow quickly, they absorb giant quantities of the radioactive sugar. Example 2: Positive proper cervical lymph node aspiration followed by proper cervical lymph node dissection exhibiting 1 of 6 nodes optimistic symptoms 9 days past iui [url=https://delvv.com/order/Atomoxetine.html]atomoxetine 25 mg fast delivery[/url].
博客作者 Farmonalbuh
How the recommendations may affect prHow the recommendations might have an effect on practiceactice the recommendations are consistent with present greatest apply, and will standardise follow. Cultural procedures and interpretation When microscopy of the specimen demonstrates an appropriate high quality of the sputum, choose a floccule of purulent material (or of essentially the most nearly purulent materials obtainable) using a sterile swap or loop and inoculate on to the assorted culture plates. Efforts ought to be made to reduce intestinal illness exercise as a result of successful administration of the illness process reduces episodes of diarrhea passing via the perianal space symptoms jaw pain and headache [url=https://fnfgc.com/health/Flutamide.html]flutamide 250 mg buy line[/url].
Thomas D’Hooghe Research grants from Merck Serono, Schering Plough, Ferring, Bayer Healthcare. Mouth ulcers Go back to contents page Nappy rash Illness Up to a third of babies and toddlers in nappies have nappy rash at anyone time. From 1901 to the present, by way of many processes, Later renements on the method were made in Germany mostly German and French, have perfected the preliminary in 1927 (German Patent 505,354) and 1933 erectile dysfunction doctor philippines [url=https://fnfgc.com/health/Tadalafilum.html][/url].
博客作者 canadian pharmaceuticals
This site was… how do I say it? Relevant!! Finally I have found something which helped me. Cheers!