不好或长期要求

时间:2016-11-10 22:24:18

标签: java html spring spring-mvc tomcat

我有一个很长的形式,有时会话无效,当我按下提交按钮时,我丢失了所有数据。幸运的是,我设法在登录表单上重定向后保存下一个URL。它工作正常,没有任何其他链接的问题。

但是当我尝试下面的长形式的查询时:

 http://localhost:8080/ao-server/administration/connexion_admin?next=http%3A%2F%2Flocalhost%3A8080%2Fao-server%2Fadministration%2FAO%2Fsave%3Fetat_ao%3Dnew%26pme%3D0%26acheteur%3D1274%26typemarche%3D9%26reference%3D51%252FMEK%252F2016%2B%26dateouvertureplis%3D01%252F12%252F2016%26heure%3D09%26minute%3D00%26objet%3DEtude%2BArchitecturale%2Bet%2Bsuivi%2Bdes%2Btravaux%2Bd%25E2%2580%2599extension%2Bde%2BS%252FS%2BOuled%2BSlime%2Bcentre%2BCR%2BM%25E2%2580%2599Haya%2BProvince%2Bde%2BMekn%25C3%25A8s%2B%26estimation%3D2%26provinces%3D17-3%26datepublication%3D05%252F11%252F2016%26selectedactivites%3D505-3%26idao%3D16399%26from%3Dcontrole%26idfils%3D%26idModif%3D%26origin%3D%26content%3D%253Cstrong%253EROYAUME%2BDU%2BMAROC%2B%253Cbr%253E%253Cbr%253EMINIST%25C3%2588RE%2BDE%2BL%25E2%2580%2599EDUCATION%2BNATIONALE%2BET%2BDE%2BLA%2BFORMATION%2BPROFESSIONNELLE%2B%253Cbr%253E%253Cbr%253EACAD%25C3%2589MIE%2BR%25C3%2589GIONALE%2BDE%2BL%25E2%2580%2599%25C3%2589DUCATION%2BET%2BDE%2BLA%2BFORMATION%2BR%25C3%2589GION%2BDE%2BF%25C3%2588S-MEKN%25C3%2588S%2B%253Cbr%253E%253Cbr%253EDIRECTION%2BPROVINCIALE%2BDE%2BMEKN%25C3%2588S%2B%253Cbr%253E%253Cbr%253ESERVICE%2BDES%2BAFFAIRES%2BADMINISTRATIVES%2BET%2BFINANCI%25C3%2588RES%2B%253Cbr%253E%253Cbr%253EBUREAU%2BDES%2BMARCHES%253C%252Fstrong%253E%253Cbr%253E%253Cbr%253E%253Cbr%253EAVIS%2BDE%2BCONSULTATION%2BARCHITECTURALE%2BN%25C2%25B0%25C2%25A0%253Cstrong%253E51%252FMEK%252F2016%253C%252Fstrong%253E%25C2%25A0%253Cbr%253E%253Cbr%253E%253Cbr%253E%253Cstrong%253ELe%2B01%252F12%252F2016%2B%25C3%25A0%2Bpartir%2Bde%2B09%2BH%253C%252Fstrong%253E%2B%252Cselon%2Bci-apr%25C3%25A8s%252C%2Bil%2Bsera%2Bproc%25C3%25A9d%25C3%25A9%2Bdans%2Bla%2Bsalle%2Bdes%2Br%25C3%25A9unions%2B%25C3%25A0%2Bla%2BDirection%2BProvinciale%2Bde%2BAcad%25C3%25A9mie%2Br%25C3%25A9gionale%2Bde%2Bl%25E2%2580%2599%25C3%25A9ducation%2Bet%2Bde%2Bla%2Bformation%2BR%25C3%25A9gion%2Bde%2BF%25C3%25A8s-Mekn%25C3%25A8s%252C%2BAvenue%2BAbdelkrim%2BEl%2BKhattabi%2BSbata%2B%25C3%25A0%2BMekn%25C3%25A8s%2B%25C3%25A0%2Bl%25E2%2580%2599ouverture%2Bdes%2Bplis%2Bdes%2Barchitectes%2Brelatif%2Bau%2Bconsultation%2Barchitecturale%2Bsuivante%253A%2B%253Cbr%253E%253Cbr%253E-%2BN%25C2%25B0%2Bde%2Bla%2Bconsultation%2Barchitecturale%253A%2B%253Cstrong%253E51%252FMEK%252F2016%253C%252Fstrong%253E%2B%253Cbr%253E%253Cbr%253E-%2BObjet%253A%2B%253Cstrong%253EEtude%2BArchitecturale%2Bet%2Bsuivi%2Bdes%2Btravaux%2Bd%25E2%2580%2599extension%2Bde%2BS%252FS%2BOuled%2BSlime%2Bcentre%2BCR%2BM%25E2%2580%2599Haya%2BProvince%2Bde%2BMekn%25C3%25A8s%253C%252Fstrong%253E%2B%253Cbr%253E%253Cbr%253E%253Cstrong%253E-%2BBudget%2BPr%25C3%25A9visionnel%2Bmax%2BHT%253C%252Fstrong%253E%2Bpour%2Bl%25E2%2580%2599ex%25C3%25A9cution%2Bdes%2Btravaux%2Ben%2BDhs%253A%2B%253Cstrong%253E666%2B000.00%2BDH%253C%252Fstrong%253E%2BSix%2Bcent%2Bsoixante-six%2Bmille%2B%253Cbr%253E%253Cbr%253ELe%2Bdossier%2Bde%2Bla%2Bconsultation%2Barchitecturale%2Bpeut%2B%25C3%25AAtre%2Bretir%25C3%25A9%2Bau%2BBureau%2Bdes%2Bmarch%25C3%25A9s%2Bde%2Bla%2BDirection%2BProvinciale%2Bde%2Bl%25E2%2580%2599AREF%2BR%25C3%25A9gion%2BF%25C3%25A8s-Mekn%25C3%25A8s%2B%25C3%25A0%2BMekn%25C3%25A8s%252C%2Bil%2Bpeut%2B%25C3%25A9galement%2B%25C3%25AAtre%2Bt%25C3%25A9l%25C3%25A9charg%25C3%25A9%2B%25C3%25A0%2Bpartir%2Bdu%2Bportail%2Bdes%2Bmarch%25C3%25A9s%2Bpublics%2Bwww.marchespublics.gov.ma%2B%253Cbr%253E%253Cbr%253ELe%2Bcontenu%2Bainsi%2Bque%2Bla%2Bpr%25C3%25A9sentation%2Bdes%2Bdossiers%2Bdes%2Bconcurrents%2Bdoivent%2B%25C3%25AAtre%2Bconformes%2Baux%2Bdispositions%2Bdes%2Barticles%2B100%252C%2B101%2Bet%2B102%2Bdu%2Bd%25C3%25A9cret%2Bn%25C2%25B0%2B2-12-349%2Bdu%2B8%2Bjoumada%2BI%2B1434%2B%252820%2Bmars%2B2013%2529%2Bfixant%2Bles%2Bconditions%2Bet%2Bles%2Bformes%2Bde%2Bpassation%2Bdes%2Bmarch%25C3%25A9s%2Bpour%2Ble%2Bcompte%2Bde%2Bl%25E2%2580%2599Etat%2Bet%2Bdes%2B%25C3%25A9tablissements%2Bpublics%2Bainsi%2Bque%2Bcertaines%2Br%25C3%25A8gles%2Brelatives%2B%25C3%25A0%2Bleurs%2Bgestion%2Bet%2B%25C3%25A0%2Bleur%2Bcontr%25C3%25B4le.%2B%253Cbr%253E%253Cbr%253ELes%2Barchitectes%2Bpeuvent%253A%2B%253Cbr%253E%253Cbr%253E-Soit%2Bd%25C3%25A9poser%2Bcontre%2Br%25C3%25A9c%25C3%25A9piss%25C3%25A9%2Bleurs%2Bplis%2Bdans%2BBureau%2Bdes%2Bmarch%25C3%25A9s%2Bde%2Bla%2BDirection%2BProvinciale%2Bde%2BMekn%25C3%25A8s.%2B%253Cbr%253E-Soit%2Bles%2Benvoyer%252C%2Bpar%2Bcourrier%2Brecommand%25C3%25A9%2Bavec%2Baccus%25C3%25A9%2Bde%2Br%25C3%25A9ception%2Bau%2BBureau%2Bpr%25C3%25A9cit%25C3%25A9.%2B%253Cbr%253E-Soit%2Bles%2Bremettre%2Bau%2Bpr%25C3%25A9sident%2Bdu%2Bjury%2Bde%2Bla%2Bconsultation%2Barchitecturale%2Bau%2Bd%25C3%25A9but%2Bde%2Bla%2Bs%25C3%25A9ance%2Bet%2Bavant%2Bl%25E2%2580%2599ouverture%2Bdes%2Bplis.%2B%253Cbr%253E%253Cbr%253ELes%2Bpi%25C3%25A8ces%2Bjustificatives%2B%25C3%25A0%2Bfournir%2Bsont%2Bcelles%2Bpr%25C3%25A9vues%2Bpar%2Bl%25E2%2580%2599article%2B10%2Bdu%2Br%25C3%25A8glement%2Bde%2Bconsultation%2Barchitecturale.%253Cbr%253E%253Cbr%253E%2BLes%2Bpi%25C3%25A8ces%2Bfournies%2Bdoivent%2B%25C3%25AAtre%2Boriginales%2Bou%2Bcopies%2Bcertifi%25C3%25A9es%2Bconformes%2B%25C3%25A0%2Bl%25E2%2580%2599original%2Bde%2Bmoins%2Bde%2Btrois%2Bmois.

我遇到了这个例外:

nov. 10, 2016 10:10:29 PM org.apache.coyote.http11.AbstractHttp11Processor process
INFOS: Error parsing HTTP request header

这是一个糟糕的请求

Request Method:POST
Status Code:400 bad request 

或者这是一个很长的查询,因为当我保存表单并记录用户时它直接工作的链接

那么如何解决这个问题以防止我的管理员重复长篇表格?

2 个答案:

答案 0 :(得分:1)

如果请求URL超过4000个字符(并且您的示例大于5000),您可以获得Http 400响应,具体取决于浏览器/服务器端实现。

答案 1 :(得分:0)

  

我有一个很长的形式,有时会话无效   当我按下提交按钮时,我丢失了所有数据。幸运的是,我   设法在登录表单上重定向后保存下一个URL。

您不能在您的案例中使用网址重定向作为整个数据在网址中可见的表单。

您可以通过将用户数据保存到数据库然后调度到下一个(第二个)页面来解决此问题,因为您说用户会话可能会超时。因此,如果将其保存到数据库,那么您实际上可以提示用户离开的位置。