Posts

Validation messages are displaying at the bottom of the page JSF - javax faces developmentstage messages -

i stuck displaying error message in jsf. requirement given below: i have user form, user has enter details firstname, lastname, username , emailaddress. these fields mandatory, among these fields, username , emailaddress unique. when user enters fields, , if clicks save @ backend have check whether username , email address exists in db, if exists have show error message on top of page saying "the data entered exists, please reenter again". and validation messages firstname , lastname should display on side of each field. can't use <h:messages> because displays validation messages @ once. so populating hidden field in form message using following code: context.addmessage("addusererrormessage", new facesmessage("the data entered exists, please reenter again")); addusererrormessage id of hidden form field. but when displaying message @ top of page <h:message for="adduserformmessage"> the message being displa...

sql - Extendable Database Schema - How to store the extendable attribute values -

we using sql server 2008 , 1 of requirements have extendable user defined attributes on entities defined system. example, might have entity called doctor, want admins of system able define attributes not in system. these attributes needed query criteria linking parent or joiner tables. there tables define attributes (name, description, type) , forth, question on storage of actual data values. im not dba (just programmer pretending one) first thought store them in 1 generic column nvarchar(450) this cover of basic types , still allow index, thought run lots of conversion type issues (converting dates, numbers, etc.) unusual query issues since nvarchar. so, latest thinking create column each data type support: colnvarchardata nvarchar(450) colbitdata bit colintdata int ..and forth when user defined extendable attribute, pick data type , store attribute value in column type. example, if picked int, data value stored colintdata , other 2 columns null in example. ...

c++ - Boost:regex_search - match string between brackets -

given part of logstring: ... http/1.1" 206 391402 "-" "applecoremedia/1.0.0.8b117 (ipod; u; cpu os 4_1 mac os x; de_de)" i need match last substring inside brackets remote system info string. i'm not regular expressions understanding have escape brackets " \( " , " \) ". now match whole string thought i'd have like: \(\.*\) dot matching , " * " specifying random amount of dots. but does't work. neither (\.*) or (.*) expect. there must problem opening , closing brackets because seg fault when trying match string way. can me please? ok sorry bothering you. did trick: boost::regex f_sourcedir(conf.pstring("filter_sourcefiles")), f_string(conf.pstring("filter_string")), m_first(conf.pstring("field0")), m_second("\\(([^)]+)\\)\"$",boost::regex::perl), m_third(conf.pstring("field2")), m_fo...

asp.net - Setting folder default page in aspnet -

my question simple. have web application multiple sub-folders , there's no default.aspx page in of these. how set default page in each of these folders users can type /folder instead of /folder/login.aspx? can done through web.config file? should rename file in each folder default.aspx? thanks! there default document section web.config , , can put web.config in each folder, , inside config have default document set.

mysql - Comparing Dates In Sub Query Returns No Results -

i've got mysql query: select some_fields, (select slug photos date_added > p.date_added order date_added asc ) next, (select slug photos date_added < p.date_added order date_added desc ) prev photos p slug = 'test' to photos table, next , previous images tagging along in same query. if remove 'prev' part of query runs , returns result, 'prev' part no results retruned reason. weirdly, if switch < > in 'prev' part returns (an incorrect) result, there's problem comparing 2 datetimes that. i'm @ wit's end honest, no idea be... i'd prefer join photos table itself, not least because not has "next" photo, want outer join. here's query doesn't work: select some_fields, next.slug, prev.slug photos current left join photos next on (current.date_added < next.date_added) lef...

cgi - Perl Mojolicious - How to make it handle multiple connections at once? -

i setup quick mojolicious server this: use mojolicious::lite; '/' => sub { $self = shift; sleep 5; #sleep here, i'm testing multiple connections @ once $self->render_text('hello world!'); }; app->start; i start with: perl mojolicious.pl daemon --listen=https://127.0.0.1:3000 problem is, if run command concurrently: time curl https://127.0.0.1:3000/ -k it seems use 1 thread requests, because if make multiple requests @ once, can take longer 5 seconds. it's if queued up. am missing here? i'm wanting use mojolicous, if can handle more 1 client @ time. mojo daemon standalone http server meant development use, not production, , runs single thread. production want either use fastcgi option , fastcgi-supporting webserver, or install nice psgi -compatible server starman or starlet or plack::handler::fcgi or fastpass , do plackup -s starman --port 3000 mojolicious.pl

django - Maintaining URL parameters across page views -

i writing django application , provide optional filters , sort options results displayed. represent these optional filters , sort options using restful urls such as / /tags/tag1/ /tags/tag1/page2 /tags/tag1/by/newest-desc/ /tags/tag1/by/newest-desc/page2 etc. how should maintain existing url filters or sort options across page views? have tried using {% url 'list-view' tags=tags sort=sort-option %} in templates these cause problems when viewing pages without both tags , sort-option parameters set. this problem similar using both sort & filter on queryset looking restful url solution, not parameter or session state variable solution. any suggestions appreciated. niall sort order should get parameter should page number. they'll easier handle way. think way: /tags/tag1 indicate viewing. other 2 indicate display options.